MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / UpdateLedger

Method UpdateLedger

ledger.go:135–142  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

133// - *model.Ledger: A pointer to the updated Ledger model.
134// - error: An error if the ledger could not be updated.
135func (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}

Callers 2

TestUpdateLedgerFunction · 0.95
TestUpdateLedgerNotFoundFunction · 0.95

Calls 2

postLedgerActionsMethod · 0.95
UpdateLedgerMethod · 0.65

Tested by 2

TestUpdateLedgerFunction · 0.76
TestUpdateLedgerNotFoundFunction · 0.76