Skip to content

Commit 3211104

Browse files
committed
fix(website): reimplmement missing useDefineNewPassword
1 parent 9575b5d commit 3211104

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

apps/website/src/components/Auth/DefineNewPasswordForm/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use client';
22

3+
import { PagesRoutes } from '@/Routes';
34
import {
45
Button,
56
DefineNewPasswordForm as DefineNewPasswordFormUI,
67
type DefineNewPassword,
78
} from '@intlayer/design-system';
89
import { useDefineNewPassword } from '@intlayer/design-system/hooks';
910
import { Check } from 'lucide-react';
10-
import { useRouter } from 'next/navigation';
1111
import { useIntlayer } from 'next-intlayer';
12+
import { useRouter } from 'next/navigation';
1213
import type { FC } from 'react';
13-
import { PagesRoutes } from '@/Routes';
1414

1515
type ForgotPasswordFormProps = {
1616
userId: string;

packages/@intlayer/design-system/src/hooks/intlayerAPIHooks.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,27 @@ export const useLogin = (
153153
invalidateQueries: ['getSession'],
154154
...args,
155155
});
156+
156157
export const useRegister = (
157158
args?: UseAsyncOptions<IntlayerAPI['auth']['register']>
158159
) =>
159160
useAppAsync('register', useIntlayerAuth().auth.register, {
160161
invalidateQueries: ['getSession'],
161162
...args,
162163
});
164+
163165
export const useLogout = (
164166
args?: UseAsyncOptions<IntlayerAPI['auth']['logout']>
165167
) =>
166168
useAppAsync('logout', useIntlayerAuth().auth.logout, {
167169
invalidateQueries: ['getSession'],
168170
...args,
169171
});
172+
170173
export const useChangePassword = (
171174
args?: UseAsyncOptions<IntlayerAPI['auth']['changePassword']>
172175
) => useAppAsync('changePassword', useIntlayerAuth().auth.changePassword, args);
176+
173177
export const useAskResetPassword = (
174178
args?: UseAsyncOptions<IntlayerAPI['auth']['askResetPassword']>
175179
) =>
@@ -179,6 +183,15 @@ export const useAskResetPassword = (
179183
args
180184
);
181185

186+
export const useDefineNewPassword = (
187+
args?: UseAsyncOptions<IntlayerAPI['auth']['defineNewPassword']>
188+
) =>
189+
useAppAsync(
190+
'defineNewPassword',
191+
useIntlayerAuth().auth.defineNewPassword,
192+
args
193+
);
194+
182195
export const useCheckIfUserHasPassword = (
183196
args?: UseAsyncOptions<IntlayerAPI['auth']['checkIfUserHasPassword']>
184197
) =>
@@ -190,6 +203,7 @@ export const useCheckIfUserHasPassword = (
190203
requireUser: true,
191204
}
192205
);
206+
193207
export const useVerifyEmail = (
194208
args?: UseAsyncOptions<IntlayerAPI['auth']['verifyEmail']>
195209
) => useAppAsync('verifyEmail', useIntlayerAuth().auth.verifyEmail, args);
@@ -225,20 +239,23 @@ export const useGetUsers = (
225239
requireUser: true,
226240
}
227241
);
242+
228243
export const useCreateUser = (
229244
args?: UseAsyncOptions<IntlayerAPI['user']['createUser']>
230245
) =>
231246
useAppAsync('createUser', useIntlayerAuth().user.createUser, {
232247
invalidateQueries: ['getUsers'],
233248
...args,
234249
});
250+
235251
export const useUpdateUser = (
236252
args?: UseAsyncOptions<IntlayerAPI['user']['updateUser']>
237253
) =>
238254
useAppAsync('updateUser', useIntlayerAuth().user.updateUser, {
239255
invalidateQueries: ['getSession'],
240256
...args,
241257
});
258+
242259
export const useDeleteUser = (
243260
args?: UseAsyncOptions<IntlayerAPI['user']['deleteUser']>
244261
) =>
@@ -282,6 +299,7 @@ export const useAddOrganization = (
282299
...args,
283300
}
284301
);
302+
285303
export const useUpdateOrganization = (
286304
args?: UseAsyncOptions<IntlayerAPI['organization']['updateOrganization']>
287305
) =>
@@ -293,6 +311,7 @@ export const useUpdateOrganization = (
293311
...args,
294312
}
295313
);
314+
296315
export const useUpdateOrganizationMembers = (
297316
args?: UseAsyncOptions<
298317
IntlayerAPI['organization']['updateOrganizationMembers']
@@ -306,6 +325,7 @@ export const useUpdateOrganizationMembers = (
306325
...args,
307326
}
308327
);
328+
309329
export const useAddOrganizationMember = (
310330
args?: UseAsyncOptions<IntlayerAPI['organization']['addOrganizationMember']>
311331
) =>
@@ -317,6 +337,7 @@ export const useAddOrganizationMember = (
317337
...args,
318338
}
319339
);
340+
320341
export const useDeleteOrganization = (
321342
args?: UseAsyncOptions<IntlayerAPI['organization']['deleteOrganization']>
322343
) =>
@@ -328,6 +349,7 @@ export const useDeleteOrganization = (
328349
...args,
329350
}
330351
);
352+
331353
export const useSelectOrganization = (
332354
args?: UseAsyncOptions<IntlayerAPI['organization']['selectOrganization']>
333355
) =>
@@ -339,6 +361,7 @@ export const useSelectOrganization = (
339361
...args,
340362
}
341363
);
364+
342365
export const useUnselectOrganization = (
343366
args?: UseAsyncOptions<IntlayerAPI['organization']['unselectOrganization']>
344367
) =>
@@ -375,20 +398,23 @@ export const useGetProjects = (
375398
requireOrganization: true,
376399
}
377400
);
401+
378402
export const useAddProject = (
379403
args?: UseAsyncOptions<IntlayerAPI['project']['addProject']>
380404
) =>
381405
useAppAsync('addProject', useIntlayerAuth().project.addProject, {
382406
invalidateQueries: ['getProjects'],
383407
...args,
384408
});
409+
385410
export const useUpdateProject = (
386411
args?: UseAsyncOptions<IntlayerAPI['project']['updateProject']>
387412
) =>
388413
useAppAsync('updateProject', useIntlayerAuth().project.updateProject, {
389414
invalidateQueries: ['getSession'],
390415
...args,
391416
});
417+
392418
export const useUpdateProjectMembers = (
393419
args?: UseAsyncOptions<IntlayerAPI['project']['updateProjectMembers']>
394420
) =>
@@ -400,41 +426,47 @@ export const useUpdateProjectMembers = (
400426
...args,
401427
}
402428
);
429+
403430
export const useDeleteProject = (
404431
args?: UseAsyncOptions<IntlayerAPI['project']['deleteProject']>
405432
) =>
406433
useAppAsync('deleteProject', useIntlayerAuth().project.deleteProject, {
407434
invalidateQueries: ['getProjects', 'getSession'],
408435
...args,
409436
});
437+
410438
export const useSelectProject = (
411439
args?: UseAsyncOptions<IntlayerAPI['project']['selectProject']>
412440
) =>
413441
useAppAsync('selectProject', useIntlayerAuth().project.selectProject, {
414442
invalidateQueries: ['getSession'],
415443
...args,
416444
});
445+
417446
export const useUnselectProject = (
418447
args?: UseAsyncOptions<IntlayerAPI['project']['unselectProject']>
419448
) =>
420449
useAppAsync('unselectProject', useIntlayerAuth().project.unselectProject, {
421450
invalidateQueries: ['getSession'],
422451
...args,
423452
});
453+
424454
export const useAddNewAccessKey = (
425455
args?: UseAsyncOptions<IntlayerAPI['project']['addNewAccessKey']>
426456
) =>
427457
useAppAsync('addNewAccessKey', useIntlayerAuth().project.addNewAccessKey, {
428458
invalidateQueries: ['getSession'],
429459
...args,
430460
});
461+
431462
export const useDeleteAccessKey = (
432463
args?: UseAsyncOptions<IntlayerAPI['project']['deleteAccessKey']>
433464
) =>
434465
useAppAsync('deleteAccessKey', useIntlayerAuth().project.deleteAccessKey, {
435466
invalidateQueries: ['getSession'],
436467
...args,
437468
});
469+
438470
export const useRefreshAccessKey = (
439471
args?: UseAsyncOptions<IntlayerAPI['project']['refreshAccessKey']>
440472
) =>
@@ -511,6 +543,7 @@ export const useGetDictionary = (
511543
requireProject: true,
512544
}
513545
);
546+
514547
export const useAddDictionary = (
515548
args?: UseAsyncOptions<IntlayerAPI['dictionary']['addDictionary']>
516549
) =>
@@ -534,6 +567,7 @@ export const usePushDictionaries = (
534567
...args,
535568
}
536569
);
570+
537571
export const useUpdateDictionary = (
538572
args?: UseAsyncOptions<IntlayerAPI['dictionary']['updateDictionary']>
539573
) =>
@@ -545,6 +579,7 @@ export const useUpdateDictionary = (
545579
...args,
546580
}
547581
);
582+
548583
export const useDeleteDictionary = (
549584
args?: UseAsyncOptions<IntlayerAPI['dictionary']['deleteDictionary']>
550585
) =>
@@ -585,20 +620,23 @@ export const useGetTags = (
585620
requireOrganization: true,
586621
}
587622
);
623+
588624
export const useAddTag = (
589625
args?: UseAsyncOptions<IntlayerAPI['tag']['addTag']>
590626
) =>
591627
useAppAsync('addTag', useIntlayerAuth().tag.addTag, {
592628
invalidateQueries: ['getTags'],
593629
...args,
594630
});
631+
595632
export const useUpdateTag = (
596633
args?: UseAsyncOptions<IntlayerAPI['tag']['updateTag']>
597634
) =>
598635
useAppAsync('updateTag', useIntlayerAuth().tag.updateTag, {
599636
invalidateQueries: ['getTags'],
600637
...args,
601638
});
639+
602640
export const useDeleteTag = (
603641
args?: UseAsyncOptions<IntlayerAPI['tag']['deleteTag']>
604642
) =>

0 commit comments

Comments
 (0)