Fixed errors with suppliers
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<tr>
|
||||
<td>{{ product.productName }}</td>
|
||||
<td>{{ product.productReference }}</td>
|
||||
<td>Prix €€€€</td>
|
||||
<td>{{ product.productPrice }}</td>
|
||||
<td>{{ product.quantity }}</td>
|
||||
<td>
|
||||
<div style="justify-content: center; display: flex">
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-center">
|
||||
@for (product of supplier.prices; track product.id) {
|
||||
@for (product of supplier.prices; track product.productId) {
|
||||
<tr>
|
||||
<td>{{ product.productName }}</td>
|
||||
<td>{{ product.productReferences }}</td>
|
||||
<td>{{ product.productReference }}</td>
|
||||
<td>{{ product.sellingPrice }}€</td>
|
||||
<td>
|
||||
<div class="flex items-center justify-center space-x-2">
|
||||
@@ -49,7 +49,7 @@
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
<nz-icon nzType="delete" nzTheme="outline"
|
||||
class="cursor-pointer text-red-600 hover:text-red-800"
|
||||
(click)="deleteProduct(product.productId, product.supplierId)"></nz-icon>
|
||||
(click)="deleteProduct(product.productId, supplier.id)"></nz-icon>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -159,7 +159,7 @@ export class SupplierTable implements OnInit {
|
||||
|
||||
async deleteProduct(idProduct: number, idSupplier: number) {
|
||||
try {
|
||||
await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idProduct, idSupplier));
|
||||
await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idSupplier, idProduct));
|
||||
this.notificationService.success('Succès', 'Produit supprimé');
|
||||
await this.fetchSuppliers();
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user