Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Development #240

Merged
merged 2 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed pagination issue
  • Loading branch information
ilyaskarim committed Oct 21, 2020
commit f21f6313c091f474125477649aa70eaee3e24ac4
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wertik-js",
"version": "1.9.97-beta",
"version": "1.9.97",
"main": "lib/main.js",
"repository": "https://github.com/Uconnect-Technologies/wertik-js.git",
"welcomeResponse": "Welcome to wertik, You are successfully running Wertik.",
Expand Down
1 change: 1 addition & 0 deletions src/framework/graphql/crudGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ export const generateListTypeForModule = (module: IConfigurationCustomModule) =>
pagination: Pagination
filters: [Filter]
sorting: Sorting
paginationProperties: PaginationProperties
}
type ${module.name}BulkMutationResponse {
returning: [${module.name}]
Expand Down
172 changes: 1 addition & 171 deletions src/framework/reporting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export const substractDays = (num) => {
return moment().subtract(num, "d");
};

/// mysql

export const getQueryForLast7Days = function (tableName: String) {
return `
SELECT count(*) as total_created_last_7_days FROM ${tableName}
Expand Down Expand Up @@ -114,172 +112,4 @@ export const getQueryForLastYear = function (tableName: String) {
AND
'${getYear() - 1}-12-31'
`;
};

/// mongoose

// export const mongoose = {
// getTotalCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments({}, function (err, count) {
// resolve(count);
// });
// } catch (e) {
// reject(e);
// }
// });
// },
// getThisMonthCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().startOf("month").toDate().toISOString(),
// $lt: moment().endOf("month").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// getLastMonthCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().subtract(1, "month").startOf("month").toDate().toISOString(),
// $lt: moment().subtract(1, "month").endOf("month").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// getThisWeekCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().startOf("isoWeek").toDate().toISOString(),
// $lt: moment().endOf("isoWeek").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// getLast7DaysCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().subtract(7, "days").startOf("day").toDate().toISOString(),
// $lt: moment().endOf("day").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// getTodayCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().startOf("day").toDate().toISOString(),
// $lt: moment().endOf("day").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// getThisYearCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().startOf("year").toDate().toISOString(),
// $lt: moment().endOf("year").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// getLast90DaysCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().subtract(90, "days").startOf("day").toDate().toISOString(),
// $lt: moment().endOf("day").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// getLastYearCount: function (model) {
// return new Promise((resolve, reject) => {
// try {
// model.countDocuments(
// {
// created_at: {
// $gt: moment().subtract(1, "year").startOf("year").toDate().toISOString(),
// $lt: moment().subtract(1, "year").endOf("year").toDate().toISOString(),
// },
// },
// function (err, count) {
// resolve(count);
// }
// );
// } catch (e) {
// reject(e);
// }
// });
// },
// };
};