u
This commit is contained in:
@@ -2,10 +2,10 @@ import sql from 'mssql';
|
||||
import { CREATE } from '../../sql/category.js';
|
||||
|
||||
export default function create(pool) {
|
||||
return async ({ parent_id, sort }) => {
|
||||
return async ({ parentId, sort }) => {
|
||||
const result = await pool
|
||||
.request()
|
||||
.input('parentId', sql.Int, parent_id)
|
||||
.input('parentId', sql.Int, parentId)
|
||||
.input('sort', sql.Int, sort)
|
||||
.query(CREATE);
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ export default function create(pool) {
|
||||
|
||||
return {
|
||||
id: result.recordset[0].id,
|
||||
root_category_id: rootCategoryId,
|
||||
language_id: languageId,
|
||||
taxrate_id: taxrateId,
|
||||
reducedtaxrate_id: reducedtaxrateId,
|
||||
taxfreerate_id: taxfreerateId,
|
||||
rootCategoryId,
|
||||
languageId,
|
||||
taxrateId,
|
||||
reducedtaxrateId,
|
||||
taxfreerateId,
|
||||
};
|
||||
} catch (err) {
|
||||
try {
|
||||
|
||||
@@ -45,11 +45,11 @@ export default function update(pool) {
|
||||
|
||||
return {
|
||||
id,
|
||||
root_category_id: company.root_category_id,
|
||||
language_id: languageId,
|
||||
taxrate_id: taxrateId,
|
||||
reducedtaxrate_id: reducedtaxrateId,
|
||||
taxfreerate_id: company.taxfreerate,
|
||||
rootCategoryId: company.root_category_id,
|
||||
languageId,
|
||||
taxrateId,
|
||||
reducedtaxrateId,
|
||||
taxfreerateId: company.taxfreerate,
|
||||
};
|
||||
} catch (err) {
|
||||
try {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import sql from 'mssql';
|
||||
import { DEL } from '../../sql/google_auth.js';
|
||||
|
||||
export default function del(pool) {
|
||||
return async (id) => {
|
||||
await pool
|
||||
.request()
|
||||
.input('id', sql.Int, id)
|
||||
.query(DEL);
|
||||
};
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import sql from 'mssql';
|
||||
import { GET_BY_ID } from '../../sql/google_auth.js';
|
||||
|
||||
export default function getById(pool) {
|
||||
return async (id) => {
|
||||
const result = await pool
|
||||
.request()
|
||||
.input('id', sql.Int, id)
|
||||
.query(GET_BY_ID);
|
||||
|
||||
return result.recordset[0];
|
||||
};
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { LIST } from '../../sql/google_auth.js';
|
||||
|
||||
export default function list(pool) {
|
||||
return async () => {
|
||||
const result = await pool.request().query(LIST);
|
||||
return result.recordset;
|
||||
};
|
||||
}
|
||||
8
src/store/google_auth/listAllowedEmails.js
Normal file
8
src/store/google_auth/listAllowedEmails.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import { LIST_ALLOWED_EMAILS } from '../../sql/google_auth.js';
|
||||
|
||||
export default function listAllowedEmails(pool) {
|
||||
return async () => {
|
||||
const result = await pool.request().query(LIST_ALLOWED_EMAILS);
|
||||
return result.recordset;
|
||||
};
|
||||
}
|
||||
11
src/store/google_auth/removeAllowedEmail.js
Normal file
11
src/store/google_auth/removeAllowedEmail.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import sql from 'mssql';
|
||||
import { REMOVE_ALLOWED_EMAIL } from '../../sql/google_auth.js';
|
||||
|
||||
export default function removeAllowedEmail(pool) {
|
||||
return async (email) => {
|
||||
await pool
|
||||
.request()
|
||||
.input('email', sql.NVarChar(320), email)
|
||||
.query(REMOVE_ALLOWED_EMAIL);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user