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:
@@ -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"
|
||||
},
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { createContext } from 'react';
|
||||
|
||||
export const CsrfTokenContext = createContext<string | null>(null);
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user