dev
This commit is contained in:
@@ -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};
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user