[fixed] - stable

This commit is contained in:
Swapnil Bendal
2024-12-17 21:29:26 +05:30
parent bf915d8e91
commit 7de26a3c1c
4 changed files with 5 additions and 5 deletions

2
.gitignore vendored
View File

@@ -1,7 +1,7 @@
.idea/
.vscode/
node_modules/
build/
dist/
tmp/
temp/

View File

@@ -1,7 +1,7 @@
import { Product } from "../entities/Product";
export interface IProductInteractor {
createProduct(input: never): Promise<Product>;
createProduct(input: Partial<Product>): Promise<Product>;
updateStock(id: number, stock: number): Promise<Product>;
getProducts(limit: number, offset: number): Promise<Product[]>;
}

View File

@@ -19,7 +19,7 @@ class error {
error = new ApiError(
400,
messages.join(', '),
messages,
error.errors,
true,
err.stack
);

View File

@@ -3,14 +3,14 @@ class ApiError<T = unknown> extends Error {
data: T | null;
message: string;
success: boolean;
errors: Array<unknown>;
errors: Array<Error>;
isOperational: boolean;
stack?: string;
constructor(
statusCode: number,
message: string = 'Something went wrong',
errors: Array<unknown> = [],
errors: Array<Error> = [],
isOperational: boolean = true,
stack?: string
) {