From 9b4310089b3d97a220931ca56896f180879b53f2 Mon Sep 17 00:00:00 2001 From: Luke <39926192+LukeWasTakenn@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:18:47 +0200 Subject: [PATCH] fix(server): return missing locale string --- src/server/index.ts | 3 +-- .../accounts/manage-access/modals/NewAccountUserModal.tsx | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/server/index.ts b/src/server/index.ts index 417a7cf..5ed111b 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -226,8 +226,7 @@ onClientCallback( const success = await oxmysql.prepare('SELECT 1 FROM `characters` WHERE `stateId` = ?', [stateId]); - // todo locale - if (!success) return 'No person with provided state id found.'; + if (!success) return 'state_id_not_exists'; return await Ox.SetAccountAccess(accountId, stateId, role); } diff --git a/src/web/src/layouts/bank/pages/accounts/manage-access/modals/NewAccountUserModal.tsx b/src/web/src/layouts/bank/pages/accounts/manage-access/modals/NewAccountUserModal.tsx index b9e08ad..17fbc19 100644 --- a/src/web/src/layouts/bank/pages/accounts/manage-access/modals/NewAccountUserModal.tsx +++ b/src/web/src/layouts/bank/pages/accounts/manage-access/modals/NewAccountUserModal.tsx @@ -35,7 +35,7 @@ const NewAccountUserModal: React.FC<{ accountId: number }> = ({ accountId }) => async function onSubmit(values: z.infer) { setIsLoading(true); - const resp = await fetchNui( + const resp = await fetchNui( 'addUserToAccount', { accountId, ...values }, { @@ -46,7 +46,7 @@ const NewAccountUserModal: React.FC<{ accountId: number }> = ({ accountId }) => if (typeof resp === 'string') { setIsLoading(false); - form.setError('stateId', { type: 'value', message: resp }); + form.setError('stateId', { type: 'value', message: locales[resp] }); return; }