Update authentication methods and UI components, remove redundant file

This commit accomplishes a few modifications including the elimination of `use-toast.tsx` due to redundancy. The authentication methods in `personal-accounts-server-actions.ts` were refactored to improve service integration and data handling. Additionally, UI components were updated for better readability and clarity. Cascading deletion was enabled in the `schema.sql` file for 'invited_by' reference.
This commit is contained in:
giancarlo
2024-03-27 13:52:46 +08:00
parent 6699399864
commit ff19e0c204
26 changed files with 589 additions and 674 deletions

View File

@@ -20,8 +20,8 @@
"pino": "^8.19.0"
},
"devDependencies": {
"@kit/prettier-config": "0.1.0",
"@kit/eslint-config": "0.2.0",
"@kit/prettier-config": "0.1.0",
"@kit/tailwind-config": "0.1.0",
"@kit/tsconfig": "0.1.0"
},

View File

@@ -1,5 +0,0 @@
'use client';
import { createContext } from 'react';
export const CsrfTokenContext = createContext<string | null>(null);

View File

@@ -1,15 +0,0 @@
import { useContext } from 'react';
import { CsrfTokenContext } from '@kit/contexts/csrf.context';
/**
* @description Retrieves the current CSRF token in the CsrfTokenContext context
* If not found, it will return an empty string. If required, the API will throw an error
*/
function useCsrfToken() {
const token = useContext(CsrfTokenContext);
return token ?? '';
}
export default useCsrfToken;

View File

@@ -1,19 +0,0 @@
import { useCallback } from 'react';
import { useRouter } from 'next/navigation';
/**
* @name useRefreshRoute
* @description Refresh the current page. Useful for when you need to
* refresh the data on a page after a mutation. This is a temporary
* workaround until Next.js adds mutations
*/
function useRefreshRoute() {
const router = useRouter();
return useCallback(() => {
router.refresh();
}, [router]);
}
export default useRefreshRoute;