Multi tenant DB, registratie per huishouden V1.2
This commit is contained in:
+10
-10
@@ -4,16 +4,16 @@ const CategoryRepository = require("../repositories/CategoryRepository");
|
||||
class CategoryService {
|
||||
|
||||
|
||||
getCategories() {
|
||||
getCategories(householdId) {
|
||||
|
||||
return CategoryRepository.getAll();
|
||||
return CategoryRepository.getAll(householdId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
getCategory(id) {
|
||||
getCategory(id, householdId) {
|
||||
|
||||
return CategoryRepository.findById(id);
|
||||
return CategoryRepository.findById(id, householdId);
|
||||
|
||||
}
|
||||
|
||||
@@ -25,23 +25,23 @@ class CategoryService {
|
||||
}
|
||||
|
||||
|
||||
updateCategory(id, data) {
|
||||
updateCategory(id, householdId, data) {
|
||||
|
||||
return CategoryRepository.update(id, data);
|
||||
return CategoryRepository.update(id, householdId, data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
categoryHasProducts(id) {
|
||||
categoryHasProducts(id, householdId) {
|
||||
|
||||
return CategoryRepository.hasProducts(id);
|
||||
return CategoryRepository.hasProducts(id, householdId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
deleteCategory(id) {
|
||||
deleteCategory(id, householdId) {
|
||||
|
||||
return CategoryRepository.delete(id);
|
||||
return CategoryRepository.delete(id, householdId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user