From 3a00aa0475719cfd6150ac0e59cbb8df4ec3232f Mon Sep 17 00:00:00 2001 From: Lucas Chociay Date: Wed, 23 Nov 2022 09:23:02 -0300 Subject: [PATCH 1/2] fix: add expiring application props to create and update models --- src/types/models/applications.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/types/models/applications.ts b/src/types/models/applications.ts index 34839ada..410e55f5 100644 --- a/src/types/models/applications.ts +++ b/src/types/models/applications.ts @@ -38,11 +38,17 @@ type Condition = { value: string; }; -type CreateApplication = Pick & +type CreateApplication = Pick< + Application, + 'name' | 'type' | 'expiresAt' | 'canCreateExpiringApplications' +> & Partial>; type UpdateApplication = Partial< - Pick + Pick< + Application, + 'name' | 'permissions' | 'rules' | 'canCreateExpiringApplications' + > >; export type { From e8a6bfd3217776fb3274876cc777c30f96147f56 Mon Sep 17 00:00:00 2001 From: Lucas Chociay Date: Wed, 23 Nov 2022 09:26:36 -0300 Subject: [PATCH 2/2] chore: remove unnecessary partial --- src/types/models/applications.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/types/models/applications.ts b/src/types/models/applications.ts index 410e55f5..aac8b90f 100644 --- a/src/types/models/applications.ts +++ b/src/types/models/applications.ts @@ -40,15 +40,17 @@ type Condition = { type CreateApplication = Pick< Application, - 'name' | 'type' | 'expiresAt' | 'canCreateExpiringApplications' -> & - Partial>; - -type UpdateApplication = Partial< - Pick< - Application, - 'name' | 'permissions' | 'rules' | 'canCreateExpiringApplications' - > + | 'name' + | 'type' + | 'permissions' + | 'rules' + | 'canCreateExpiringApplications' + | 'expiresAt' +>; + +type UpdateApplication = Pick< + Application, + 'name' | 'permissions' | 'rules' | 'canCreateExpiringApplications' >; export type {