if (typeId === 1) { // aca_book_list const deleteBook = await prisma.aca_book_list.update({ where: { id: +productId, // is_active: true, // institution_id: +authData.institution_id, }, data: { is_active: false, } }) await BasicResponse(res, 1, 'Book Deleted', deleteBook) if (!deleteBook) { await BasicResponse(res, 0, 'Book Not Found to Delete', []) return } } if (typeId === 2 || typeId === 3) { // console.log(typeId, productId); let deleteProduct: any = await prisma.sm_products.findMany({ where: { id: productId, // is_active: true, } // data: { // is_active: false, // }, }) console.log('deleteProduct ', deleteProduct) // if (!deleteProduct) { // if (typeId === 2) { // await BasicResponse(res, 0, 'A Copies Not Found to Delete', []) // return // } // if (typeId === 3) { // await BasicResponse(res, 0, 'A Stationery Not Found to Delete', []) // return // } // } // if (typeId === 2) { // await BasicResponse(res, 1, 'A Copies Deleted', deleteProduct) // } // if (typeId === 3) { // await BasicResponse(res, 1, 'A Stationery Deleted', deleteProduct) // } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter