base con autenticacion, registro, modulo encuestas
This commit is contained in:
15
apps/web/server/home.server.ts
Normal file
15
apps/web/server/home.server.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
'use server';
|
||||
|
||||
import { safeFetch } from '@/lib/safeFetch';
|
||||
import { GetAllUsers, GetAllUsersSchema } from '@/types/user.type';
|
||||
|
||||
export const getAllUsers = async (): Promise<GetAllUsers> => {
|
||||
const [isError, data] = await safeFetch(GetAllUsersSchema, '/users', {
|
||||
cache: 'no-store',
|
||||
});
|
||||
if (isError)
|
||||
return {
|
||||
data: [],
|
||||
};
|
||||
return data;
|
||||
};
|
||||
Reference in New Issue
Block a user