Added missing bird
This commit is contained in:
@@ -250,6 +250,27 @@ export const listWorkspaceMembers = async (workspaceId: number) => {
|
||||
return result.rows;
|
||||
};
|
||||
|
||||
export const listWorkspaceNotificationEmails = async (workspaceId: number) => {
|
||||
const result = await db.query<{ email: string }>(
|
||||
`SELECT DISTINCT LOWER(TRIM(email)) AS email
|
||||
FROM (
|
||||
SELECT COALESCE(invite_email, email) AS email
|
||||
FROM workspace_members
|
||||
WHERE workspace_id = $1
|
||||
UNION
|
||||
SELECT billing_email AS email
|
||||
FROM workspaces
|
||||
WHERE id = $1
|
||||
) contact_emails
|
||||
WHERE email IS NOT NULL
|
||||
AND TRIM(email) <> ''
|
||||
ORDER BY email ASC`,
|
||||
[workspaceId],
|
||||
);
|
||||
|
||||
return result.rows.map((row) => row.email);
|
||||
};
|
||||
|
||||
export const findAlternateWorkspaceForUser = async (userId: string, excludeWorkspaceId: number) => {
|
||||
const result = await db.query<{ workspace_id: number }>(
|
||||
`SELECT workspace_id
|
||||
|
||||
Reference in New Issue
Block a user