mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-02 09:05:49 +02:00
added utils for unauth, verify, and response
This commit is contained in:
parent
d1e198fe55
commit
44e020784b
11 changed files with 125 additions and 69 deletions
|
@ -1,19 +1,17 @@
|
|||
import { ResponseT } from "@server/types/Response";
|
||||
import { Response } from "express";
|
||||
|
||||
export const response = <T>({
|
||||
data,
|
||||
success,
|
||||
error,
|
||||
message,
|
||||
status,
|
||||
}: ResponseT<T>) => {
|
||||
return {
|
||||
export const response = <T>(
|
||||
res: Response,
|
||||
{ data, success, error, message, status }: ResponseT<T>,
|
||||
) => {
|
||||
return res.status(status).send({
|
||||
data,
|
||||
success,
|
||||
error,
|
||||
message,
|
||||
status,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
export default response;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue