fix(admin): resolve 500 on missing product update and add direct image URL & paste support
Deploy Canina / deploy (push) Has been cancelled
Deploy Canina / deploy (push) Has been cancelled
This commit is contained in:
1 parent
a3291cc468
commit
9c8286c63f
3 files changed
+63
-14
No files matched your search
@@ -168,6 +168,11 @@ export class AdminService {
|
||||
}
|
||||
|
||||
async updateProduct(id: string, data: any) {
|
||||
const existing = await this.prisma.product.findUnique({ where: { id } });
|
||||
if (!existing) {
|
||||
throw new NotFoundException(`محصولی با شناسه ${id} یافت نشد.`);
|
||||
}
|
||||
|
||||
const product = await this.prisma.product.update({
|
||||
where: { id },
|
||||
data: {
|
||||
|
||||
Reference in new issue
Block a user