aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/apiParse.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-06 16:48:13 -0800
committerAdam Soltys <[email protected]>2023-02-06 16:48:13 -0800
commit9c667055c6367e1b2e239686e72f52995679a47e (patch)
tree0b1d4aee51ec2d4e92d08a9d1404ba4e2ecd462a /scripts/apiParse.js
parent15294844dbc8e73b4d1e92008a7eebc6b86b9ec5 (diff)
parent6f5602d112b68adb7452abf3047f20c32e7725b6 (diff)
downloadcoinos-server-9c667055c6367e1b2e239686e72f52995679a47e.tar.gz
coinos-server-9c667055c6367e1b2e239686e72f52995679a47e.zip
Merge branch 'master' into test
Diffstat (limited to 'scripts/apiParse.js')
-rw-r--r--scripts/apiParse.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/scripts/apiParse.js b/scripts/apiParse.js
deleted file mode 100644
index ec2a33c1..00000000
--- a/scripts/apiParse.js
+++ /dev/null
@@ -1,46 +0,0 @@
-export const addUserSearch = function(input, table) {
- var { search, starts_with, contains } = input;
-
- if (!table) {
- table = "users";
- }
- // if (since) cmd = cmd.havingRaw('invoices + payments + deposits + orders > ?', [0])
-
- if (search) {
- if (starts_with) {
- search = search + "%";
- } else if (contains) {
- search = "%" + search + "%";
- }
-
- var condition =
- "(" +
- table +
- ".email like '" +
- search +
- "' OR " +
- table +
- ".username like '" +
- search +
- "')";
-
- return condition;
- } else {
- return "";
- }
-};
-
-export const addTimeSearch = function(input, field) {
- if (!field) {
- field = "updatedAt";
- }
-
- var { since } = input;
- if (since) {
- condition = field + " >= '" + since + "'";
-
- return condition;
- } else {
- return "";
- }
-};