- Added new API path for unit mappings in `api_paths.dart`. - Implemented `upsertUnitMapping` method in `ImportRepository` to handle unit mapping creation. - Updated `ReceiptImportTab` to learn and save unit mappings during receipt import. - Created DTO for unit mapping with validation in `create-unit-mapping.dto.ts`. - Added SQL migration for `UnitMapping` table creation with necessary constraints.
This commit is contained in:
+5
-1
@@ -40,7 +40,11 @@ let PantryService = class PantryService {
|
||||
throw new common_1.ConflictException('Produkten finns redan i baslagret');
|
||||
}
|
||||
return this.prisma.pantryItem.create({
|
||||
data: { userId, productId: data.productId },
|
||||
data: {
|
||||
userId,
|
||||
productId: data.productId,
|
||||
location: data.location?.trim() || null,
|
||||
},
|
||||
include: { product: true },
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user