From 868c24a3a916e5244408a7c88fd01f5ca710e7be Mon Sep 17 00:00:00 2001 From: SKairinos Date: Fri, 2 Aug 2024 10:46:49 +0000 Subject: [PATCH] update with body --- src/utils/api.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/utils/api.ts b/src/utils/api.ts index 7936150..b61b8d2 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -103,12 +103,7 @@ type UpdateWithBody< M extends Model, RequiredFields extends keyof Omit, OptionalFields extends keyof Omit, - ExtraFields extends Fields, -> = [ - M["id"], - Arg & - ([ExtraFields] extends [never] ? {} : ExtraFields), -] +> = Pick & Arg // 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 @@ -117,14 +112,11 @@ export type UpdateArg< M extends Model, RequiredFields extends keyof Omit = never, OptionalFields extends keyof Omit = never, - ExtraFields extends Fields = never, > = [RequiredFields] extends [never] ? [OptionalFields] extends [never] - ? [ExtraFields] extends [never] - ? M["id"] - : UpdateWithBody - : UpdateWithBody - : UpdateWithBody + ? M["id"] + : UpdateWithBody + : UpdateWithBody export type BulkUpdateResult< M extends Model,