Update external types (#137)
* Separate server and frontend error logic * Update types in external api
This commit is contained in:
11
app/src/utils/errorHandling/standardResponses.ts
Normal file
11
app/src/utils/errorHandling/standardResponses.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function error(message: string): { status: "error"; message: string } {
|
||||
return {
|
||||
status: "error",
|
||||
message,
|
||||
};
|
||||
}
|
||||
export function success<T>(payload: T): { status: "success"; payload: T };
|
||||
export function success(payload?: undefined): { status: "success"; payload: undefined };
|
||||
export function success<T>(payload?: T) {
|
||||
return { status: "success", payload };
|
||||
}
|
||||
Reference in New Issue
Block a user