Link articlehistory to companyuser; store Google picture and sub on google_auth
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
export const INSERT = `
|
||||
INSERT INTO articlehistory (article_id, [text])
|
||||
VALUES (@articleId, @text)
|
||||
INSERT INTO articlehistory (article_id, companyuser_id, [text])
|
||||
VALUES (@articleId, @companyuserId, @text)
|
||||
`;
|
||||
|
||||
export const LIST_BY_ARTICLE_ID = `
|
||||
SELECT id, [date], [text]
|
||||
SELECT id, companyuser_id AS companyuserId, [date], [text]
|
||||
FROM articlehistory
|
||||
WHERE article_id = @articleId
|
||||
ORDER BY [date] DESC, id DESC
|
||||
|
||||
@@ -5,13 +5,25 @@ VALUES (@email)
|
||||
`;
|
||||
|
||||
export const GET_BY_EMAIL = `
|
||||
SELECT id, email, created_at AS createdAt, selected_company AS selectedCompanyId
|
||||
SELECT
|
||||
id,
|
||||
email,
|
||||
picture,
|
||||
sub,
|
||||
created_at AS createdAt,
|
||||
selected_company AS selectedCompanyId
|
||||
FROM google_auth
|
||||
WHERE email = @email
|
||||
`;
|
||||
|
||||
export const LIST_ALLOWED_EMAILS = `
|
||||
SELECT id, email, created_at AS createdAt, selected_company AS selectedCompanyId
|
||||
SELECT
|
||||
id,
|
||||
email,
|
||||
picture,
|
||||
sub,
|
||||
created_at AS createdAt,
|
||||
selected_company AS selectedCompanyId
|
||||
FROM google_auth
|
||||
ORDER BY email
|
||||
`;
|
||||
@@ -26,3 +38,9 @@ UPDATE google_auth
|
||||
SET selected_company = @companyId
|
||||
WHERE id = @googleAuthId
|
||||
`;
|
||||
|
||||
export const SET_PROFILE = `
|
||||
UPDATE google_auth
|
||||
SET picture = @picture, sub = @sub
|
||||
WHERE id = @googleAuthId
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user