Skip to content

Commit 23cae10

Browse files
committed
fix: saveOrUpdateClaimDraft return value
1 parent 998a0a9 commit 23cae10

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/claims-controller/src/ClaimsController.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,19 @@ export class ClaimsController extends BaseController<
232232
);
233233

234234
if (isExistingDraft) {
235+
const updatedAt = new Date().toISOString();
235236
this.update((state) => {
236237
state.drafts = state.drafts.map((existingDraft) =>
237238
existingDraft.draftId === draft.draftId
238239
? {
239240
...existingDraft,
240241
...draft,
241-
updatedAt: new Date().toISOString(),
242+
updatedAt,
242243
}
243244
: existingDraft,
244245
);
245246
});
246-
return draft as ClaimDraft;
247+
return { ...draft, updatedAt } as ClaimDraft;
247248
}
248249

249250
// generate a new draft id, name and add it to the state

0 commit comments

Comments
 (0)