Create empty service respone property.
This commit is contained in:
parent
077d63c175
commit
5c8ef1fde5
@ -1,6 +1,6 @@
|
|||||||
import { type DB, db } from "$lib/server/db/db";
|
import { type DB, db } from "$lib/server/db/db";
|
||||||
import { tasks, type taskTypes } from "$lib/server/db/schema/tasks";
|
import { tasks, type taskTypes } from "$lib/server/db/schema/tasks";
|
||||||
import type { ServiceResponse } from "$lib/server/services/service.types";
|
import type { ServiceResponse, ServiceResponseSuccess } from "$lib/server/services/service.types";
|
||||||
import { eq, type InferSelectModel } from "drizzle-orm";
|
import { eq, type InferSelectModel } from "drizzle-orm";
|
||||||
import logger from "../logger";
|
import logger from "../logger";
|
||||||
|
|
||||||
@ -62,6 +62,8 @@ class TasksService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public none: ServiceResponseSuccess<"ok", never> = { status: "ok" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch all tasks.
|
* Fetch all tasks.
|
||||||
* @returns An array of all task records with relations included.
|
* @returns An array of all task records with relations included.
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
type ServiceResponseSuccess<T, D> = {
|
export type ServiceResponseSuccess<T, D> = {
|
||||||
status: T;
|
status: T;
|
||||||
data?: D;
|
data?: D;
|
||||||
};
|
};
|
||||||
type ServiceResponseFailure<T, E> = {
|
export type ServiceResponseFailure<T, E> = {
|
||||||
status: T;
|
status: T;
|
||||||
code?: E;
|
code?: E;
|
||||||
error?: Error | string;
|
error?: Error | string;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user