Skip to content

Commit

Permalink
fix(test): update types so test can run
Browse files Browse the repository at this point in the history
  • Loading branch information
zulfikarrosadi committed Nov 21, 2024
1 parent bb63986 commit 5faa8d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/product/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ProductRepository {
return products
}

async deleteProductById(id: number) {
async deleteProductById(id: bigint) {
try {
await this.prisma.products.delete({
where: {
Expand Down
3 changes: 2 additions & 1 deletion src/product/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type UpdateProductDataService = {
new: string[]
}
}
export type FlattenUpdateProduct = Omit<UpdateProduct, 'images'> & {
export type FlattenUpdateProduct = Omit<UpdateProduct, 'images' | 'price'> & {
images: string[]
price: number
}
1 change: 1 addition & 0 deletions src/product/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('product service', () => {
createProduct: jest.fn(),
getProductById: jest.fn(),
getProducts: jest.fn(),
deleteProductById: jest.fn(),
} as unknown as jest.Mocked<ProductRepository>

productService = new ProductService(productRepo, logger)
Expand Down

0 comments on commit 5faa8d7

Please # to comment.