(nodeID string, node *drip.Node, client *ent.Client)
| 45 | } |
| 46 | |
| 47 | func 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 | |
| 77 | func ValidateNode(node *drip.Node) error { |
| 78 | if node.Id == nil { |
no test coverage detected