22 lines
No EOL
565 B
TypeScript
22 lines
No EOL
565 B
TypeScript
'use server'
|
|
|
|
import { withClientErrorHandler } from "@/withClientErrorHandler/withClientErrorHandler";
|
|
import { UserReadData } from "../../data/User/UserReadData";
|
|
|
|
async function executeUserReadService(usuarioId: number) {
|
|
|
|
// Verifica se o id informado é válido
|
|
if (usuarioId <= 0) {
|
|
return {
|
|
'code': 400,
|
|
'message': 'Usuário informado inválido',
|
|
}
|
|
}
|
|
|
|
const response = await UserReadData(usuarioId);
|
|
return response
|
|
|
|
|
|
}
|
|
|
|
export const UserReadService = withClientErrorHandler(executeUserReadService) |