-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a51557
commit 7433af2
Showing
13 changed files
with
329 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,31 @@ | ||
import { DB_SCHEMA, DB_USER_TABLE } from "../config"; | ||
import { DB_SCHEMA } from "../config"; | ||
import { User, User_Create, User_Update } from "../data/models"; | ||
import { db } from "../data"; | ||
|
||
export class UserService { | ||
async getAll(): Promise<User[]> { | ||
return db.withSchema(DB_SCHEMA).from(DB_USER_TABLE).orderBy(["FIRST_NAME", "LAST_NAME"]); | ||
return db.withSchema(DB_SCHEMA).from("users").orderBy(["first_name", "last_name"]); | ||
} | ||
|
||
async getBySub(USER_ID: string): Promise<User | undefined> { | ||
let user = await db<User>(DB_USER_TABLE).withSchema(DB_SCHEMA).where({ USER_ID }).first(); | ||
async getBySub(auth_subject: string): Promise<User | undefined> { | ||
let user = await db<User>("users").withSchema(DB_SCHEMA).where({ auth_subject }).first(); | ||
return user; | ||
} | ||
|
||
async getByEmail(EMAIL: string): Promise<User | undefined> { | ||
if (EMAIL) { | ||
let user = await db<User>(DB_USER_TABLE).withSchema(DB_SCHEMA).where({ EMAIL }).first(); | ||
async getByEmail(email: string): Promise<User | undefined> { | ||
if (email) { | ||
let user = await db<User>("users").withSchema(DB_SCHEMA).where({ email }).first(); | ||
return user; | ||
} | ||
|
||
return undefined; | ||
} | ||
|
||
async create(item: User_Create): Promise<any> { | ||
return db(DB_USER_TABLE).withSchema(DB_SCHEMA).insert(item); | ||
return db("users").withSchema(DB_SCHEMA).insert(item); | ||
} | ||
|
||
async update(EMAIL: string, item: User_Update): Promise<User> { | ||
return db(DB_USER_TABLE).withSchema(DB_SCHEMA).where({ EMAIL }).update(item); | ||
} | ||
|
||
async getSurveysByEmail(EMAIL: string) { | ||
let lines = await db("SURVEY_USER").withSchema(DB_SCHEMA).where({ EMAIL }).select("SID"); | ||
return lines.map((s) => s.SID); | ||
} | ||
|
||
async clearSurveysByEmail(EMAIL: string) { | ||
return db("SURVEY_USER").withSchema(DB_SCHEMA).where({ EMAIL }).delete(); | ||
} | ||
|
||
async setSurveysByEmail(EMAIL: string, surveys: number[]) { | ||
for (let SID of surveys) { | ||
await db("SURVEY_USER").withSchema(DB_SCHEMA).insert({ EMAIL, SID }); | ||
} | ||
return db("users").withSchema(DB_SCHEMA).where({ EMAIL }).update(item); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<template> | ||
<v-btn color="primary" to="/report-an-incident">Report an Incident</v-btn> | ||
<v-btn color="success" to="/report-an-incident" size="large"> | ||
<v-icon class="mr-4">mdi-clipboard-alert-outline</v-icon> | ||
Report an Incident</v-btn | ||
> | ||
</template> | ||
|
||
<script setup lang="ts"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<h1 class="text-h4">Report an Incident - Complete</h1> | ||
<!-- <p class="text-body-2"> | ||
Personal information is collected under the Workers' Safety and Compensation Act, Section #, for the purposes of | ||
Incident investigation and corrective action. For further information, contant the Director of Health, Safety & | ||
Wellbeing at 867-332-5974 | ||
</p> --> | ||
|
||
<v-form class="mt-6"> | ||
<section> | ||
<v-card class="default"> | ||
<v-card-item class="py-4 px-6 mb-2 bg-sun"> | ||
<h4 class="text-h6">Thank you!</h4> | ||
</v-card-item> | ||
<v-card-text> | ||
<p class="text-body-1 mb-5 mt-5"> | ||
Your submission has been received and you will recieve email notifications regarding the status of this | ||
submission. | ||
</p> | ||
<p class="text-body-1 mb-5 mt-5">At any time, you can also view your previously submitted reports on this site.</p> | ||
|
||
<div class="d-flex"> | ||
<v-btn color="primary" to="/" class="mr-5">Go back home</v-btn> | ||
<v-btn color="warning" to="/report-an-incident" variant="tonal">Submit another report</v-btn> | ||
</div> | ||
</v-card-text> | ||
</v-card> | ||
</section> | ||
</v-form> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from "vue"; | ||
const eventType = ref(null); | ||
</script> |
Oops, something went wrong.