✅ admin side for now | 🔄 started FE
This commit is contained in:
@@ -50,10 +50,11 @@ export class ProductRepository {
|
||||
}
|
||||
}
|
||||
|
||||
async getProductById(id: number): Promise<Result<ProductModel>> {
|
||||
async getProductById(id: number | string): Promise<Result<ProductModel>> {
|
||||
try {
|
||||
const result = await this.db.query.product.findFirst({
|
||||
where: eq(product.id, id),
|
||||
where:
|
||||
typeof id === "number" ? eq(product.id, id) : eq(product.linkId, id),
|
||||
});
|
||||
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user