Skip to content

Commit

Permalink
fix: update arg type
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Aug 2, 2024
1 parent 46d80f2 commit 6788669
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ type UpdateWithBody<
RequiredFields extends keyof Omit<M, "id">,
OptionalFields extends keyof Omit<M, "id" | RequiredFields>,
ExtraFields extends Fields,
> = [M["id"], Arg<M, RequiredFields, OptionalFields> & ExtraFields]
> = [
M["id"],
Arg<M, RequiredFields, OptionalFields> &
([ExtraFields] extends [never] ? {} : ExtraFields),
]

// NOTE: Sometimes update does not require a body. For example, if calling the
// "refresh" action on an invitation object updates the expiry date to be 24
Expand Down

0 comments on commit 6788669

Please sign in to comment.