UpdateLedger updates an existing ledger's name. It calls postLedgerActions after a successful update to handle indexing and webhooks. Parameters: - id: A string representing the ID of the ledger to update. - name: A string representing the new name for the ledger. Returns: - *model.Ledger: A point
(id, name string)
| 133 | // - *model.Ledger: A pointer to the updated Ledger model. |
| 134 | // - error: An error if the ledger could not be updated. |
| 135 | func (l *LedgerForge) UpdateLedger(id, name string) (*model.Ledger, error) { |
| 136 | ledger, err := l.datasource.UpdateLedger(id, name) |
| 137 | if err != nil { |
| 138 | return nil, err |
| 139 | } |
| 140 | l.postLedgerActions(context.Background(), ledger) |
| 141 | return ledger, nil |
| 142 | } |