dev
ci / docker_image (push) Successful in 1m37s
ci / deploy (push) Successful in 16s

This commit is contained in:
2025-01-31 18:51:20 -06:00
parent 5eca1635f5
commit 2acc65823b
15 changed files with 162 additions and 113 deletions
+10 -1
View File
@@ -306,7 +306,7 @@ export async function deleteCompany(id: number): Promise<void> {
export async function getCompany(id: number): Promise<Company> {
const [company] = await sql`
SELECT id, name, description, website, created_at AS "createdAt"
SELECT id, name, description, website, created_at AS "createdAt", company_code AS "companyCode"
FROM companies
WHERE id = ${id};
`;
@@ -750,3 +750,12 @@ export async function getApplications(postingId: number): Promise<Application[]>
return <Application[]>(<unknown>data);
}
export async function setUserCompanyId(userId: number, companyId: number): Promise<void> {
await sql`
UPDATE users
SET company_id = ${companyId},
company_code = (SELECT company_code FROM companies WHERE id = ${companyId})
WHERE id = ${userId};
`;
}