MCPcopy Create free account
hub / github.com/Comfy-Org/registry-backend / ApiUpdateNodeToUpdateFields

Function ApiUpdateNodeToUpdateFields

mapper/node.go:47–75  ·  view source on GitHub ↗
(nodeID string, node *drip.Node, client *ent.Client)

Source from the content-addressed store, hash-verified

45}
46
47func ApiUpdateNodeToUpdateFields(nodeID string, node *drip.Node, client *ent.Client) *ent.NodeUpdateOne {
48 update := client.Node.UpdateOneID(nodeID)
49 if node.Description != nil {
50 update.SetDescription(*node.Description)
51 }
52 if node.Author != nil {
53 update.SetAuthor(*node.Author)
54 }
55 if node.License != nil {
56 update.SetLicense(*node.License)
57 }
58 if node.Name != nil {
59 update.SetName(*node.Name)
60 }
61 if node.Tags != nil {
62 update.SetTags(*node.Tags)
63 }
64 if node.Category != nil {
65 update.SetCategory(*node.Category)
66 }
67 if node.Repository != nil {
68 update.SetRepositoryURL(*node.Repository)
69 }
70 if node.Icon != nil {
71 update.SetIconURL(*node.Icon)
72 }
73
74 return update
75}
76
77func ValidateNode(node *drip.Node) error {
78 if node.Id == nil {

Callers 2

UpdateNodeMethod · 0.92
PublishNodeVersionMethod · 0.92

Calls 9

UpdateOneIDMethod · 0.45
SetDescriptionMethod · 0.45
SetAuthorMethod · 0.45
SetLicenseMethod · 0.45
SetNameMethod · 0.45
SetTagsMethod · 0.45
SetCategoryMethod · 0.45
SetRepositoryURLMethod · 0.45
SetIconURLMethod · 0.45

Tested by

no test coverage detected