@react-pakistan/util-functions 1.24.26 → 1.24.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,10 +33,7 @@ interface DeleteExpenseCategoryArgs {
|
|
|
33
33
|
}
|
|
34
34
|
export declare const getExpenseCategories: ({ prisma, }: GetExpenseCategoriesArgs) => Promise<Array<ExpenseCategoryBE>>;
|
|
35
35
|
export declare const getExpenseCategoryById: ({ id, prisma, }: GetExpenseCategoryByIdArgs) => Promise<ExpenseCategoryBE>;
|
|
36
|
-
export declare const postExpenseCategories: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostExpenseCategoriesArgs) => Promise<
|
|
37
|
-
data: Array<ExpenseCategoryBE>;
|
|
38
|
-
error: Error | undefined;
|
|
39
|
-
}>;
|
|
36
|
+
export declare const postExpenseCategories: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostExpenseCategoriesArgs) => Promise<Array<ExpenseCategoryBE>>;
|
|
40
37
|
export declare const postExpenseCategory: ({ color, description, id, name, prisma, }: PostExpenseCategoryArgs) => Promise<Array<ExpenseCategoryBE>>;
|
|
41
38
|
export declare const deleteExpenseCategory: ({ id, prisma, }: DeleteExpenseCategoryArgs) => Promise<ExpenseCategoryBE>;
|
|
42
39
|
export {};
|
|
@@ -79,32 +79,25 @@ var getExpenseCategoryById = function (_a) { return __awaiter(void 0, [_a], void
|
|
|
79
79
|
}); };
|
|
80
80
|
exports.getExpenseCategoryById = getExpenseCategoryById;
|
|
81
81
|
var postExpenseCategories = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
82
|
-
var
|
|
82
|
+
var expenseCategories;
|
|
83
83
|
var currentPage = _b.currentPage, include = _b.include, orderBy = _b.orderBy, pageLimit = _b.pageLimit, prisma = _b.prisma, queryWhere = _b.queryWhere;
|
|
84
84
|
return __generator(this, function (_c) {
|
|
85
85
|
switch (_c.label) {
|
|
86
|
-
case 0:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
])];
|
|
86
|
+
case 0: return [4 /*yield*/, prisma.$transaction([
|
|
87
|
+
prisma.expenseCategory.count({
|
|
88
|
+
where: queryWhere,
|
|
89
|
+
}),
|
|
90
|
+
prisma.expenseCategory.findMany({
|
|
91
|
+
orderBy: orderBy,
|
|
92
|
+
include: include,
|
|
93
|
+
where: queryWhere,
|
|
94
|
+
take: pageLimit,
|
|
95
|
+
skip: (currentPage - 1) * pageLimit,
|
|
96
|
+
}),
|
|
97
|
+
])];
|
|
100
98
|
case 1:
|
|
101
|
-
|
|
102
|
-
return [
|
|
103
|
-
case 2:
|
|
104
|
-
err_1 = _c.sent();
|
|
105
|
-
error = err_1;
|
|
106
|
-
return [3 /*break*/, 3];
|
|
107
|
-
case 3: return [2 /*return*/, { data: data, error: error }];
|
|
99
|
+
expenseCategories = _c.sent();
|
|
100
|
+
return [2 /*return*/, expenseCategories];
|
|
108
101
|
}
|
|
109
102
|
});
|
|
110
103
|
}); };
|