Update external types (#137)

* Separate server and frontend error logic

* Update types in external api
This commit is contained in:
arcticfly
2023-08-11 15:02:14 -07:00
committed by GitHub
parent 8d1ee62ff1
commit d9db6d80ea
15 changed files with 70 additions and 740 deletions

View 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 };
}