This commit is contained in:
seb
2026-07-31 05:57:23 +02:00
parent b99c3a9ec7
commit 02bca8e236
14 changed files with 93 additions and 132 deletions

View File

@@ -10,7 +10,7 @@ WITH tree AS (
FROM category c
INNER JOIN tree t ON c.parent_id = t.id
)
SELECT id, parent_id, sort
SELECT id, parent_id AS parentId, sort
FROM tree
ORDER BY sort, id
`;

View File

@@ -43,11 +43,11 @@ WHERE id = @id
export const LIST = `
SELECT
id,
root_category_id,
default_language_id AS language_id,
taxrate AS taxrate_id,
reducedtaxrate AS reducedtaxrate_id,
taxfreerate AS taxfreerate_id
root_category_id AS rootCategoryId,
default_language_id AS languageId,
taxrate AS taxrateId,
reducedtaxrate AS reducedtaxrateId,
taxfreerate AS taxfreerateId
FROM company
`;

View File

@@ -4,27 +4,21 @@ OUTPUT INSERTED.id
VALUES (@email)
`;
export const GET_BY_ID = `
SELECT id, email, created_at, selected_company
FROM google_auth
WHERE id = @id
`;
export const GET_BY_EMAIL = `
SELECT id, email, created_at, selected_company
SELECT id, email, created_at AS createdAt, selected_company AS selectedCompanyId
FROM google_auth
WHERE email = @email
`;
export const LIST = `
SELECT id, email, created_at, selected_company
export const LIST_ALLOWED_EMAILS = `
SELECT id, email, created_at AS createdAt, selected_company AS selectedCompanyId
FROM google_auth
ORDER BY id
ORDER BY email
`;
export const DEL = `
export const REMOVE_ALLOWED_EMAIL = `
DELETE FROM google_auth
WHERE id = @id
WHERE email = @email
`;
export const SET_SELECTED_COMPANY = `