fix: remaining lint issues
Some checks failed
Node.js CI / Lint and Test (pull_request) Failing after 1m46s

This commit is contained in:
Naomi Carrigan 2025-02-20 15:54:42 -08:00
parent 56e2b391b2
commit 5ea66c56a0
Signed by: naomi
SSH Key Fingerprint: SHA256:rca1iUI2OhAM6n4FIUaFcZcicmri0jgocqKiTTAfrt8
4 changed files with 38 additions and 8 deletions

View File

@ -165,7 +165,8 @@ export class ApiService {
| "events"
| "meetings"
| "mentorships"
| "staff",
| "staff"
| "testimonials",
token: string,
): Promise<DataResponse | ErrorResponse> {
const request = await fetch(`${this.url}/list/${type}`, {
@ -187,7 +188,8 @@ export class ApiService {
| "events"
| "meetings"
| "mentorships"
| "staff",
| "staff"
| "testimonials",
id: string,
token: string,
): Promise<SuccessResponse | ErrorResponse> {

View File

@ -58,11 +58,21 @@
>
Staff Applications
</button>
<button
[disabled]="view === 'testimonials'"
type="button"
(click)="setView('testimonials')"
>
Testimonials
</button>
<h2>{{ view }}</h2>
<div *ngFor="let datum of data">
<h3>{{ datum.email }}</h3>
<div *ngFor="let obj of datum.info">
<p><strong>{{ obj.key }}</strong>: {{ obj.value }}</p>
<p>
<strong>{{ obj.key }}</strong
>: {{ obj.value }}
</p>
</div>
<button type="button" (click)="markReviewed(datum.id)">
Mark as Reviewed

View File

@ -41,7 +41,8 @@ export class ReviewComponent {
| "events"
| "meetings"
| "mentorships"
| "staff" = "";
| "staff"
| "testimonials" = "";
public constructor(private readonly apiService: ApiService) {
const storedToken = localStorage.getItem("token");
@ -98,7 +99,8 @@ export class ReviewComponent {
| "events"
| "meetings"
| "mentorships"
| "staff";
| "staff"
| "testimonials";
void this.apiService.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- We know token is not null
markReviewed(view, id, this.token.value!).then((data) => {
@ -120,7 +122,8 @@ export class ReviewComponent {
| "events"
| "meetings"
| "mentorships"
| "staff",
| "staff"
| "testimonials",
): void {
this.view = view;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- We know token is not null

View File

@ -14,6 +14,7 @@ import type {
Mentorships,
PrismaClient,
Staff,
Testimonials,
} from "@prisma/client";
/**
@ -27,7 +28,14 @@ const listUnreviewedSubmissions = async(
route: DatabasePath,
): Promise<
Array<
Appeals | Commissions | Contacts | Events | Meetings | Mentorships | Staff
| Appeals
| Commissions
| Contacts
| Events
| Meetings
| Mentorships
| Staff
| Testimonials
>
> => {
const query = {};
@ -46,6 +54,8 @@ const listUnreviewedSubmissions = async(
return await database.mentorships.findMany(query);
case "staff":
return await database.staff.findMany(query);
case "testimonials":
return await database.testimonials.findMany(query);
default:
return [];
}
@ -79,6 +89,8 @@ const checkSubmissionExists = async(
return Boolean(await database.mentorships.findUnique(query));
case "staff":
return Boolean(await database.staff.findUnique(query));
case "testimonials":
return Boolean(await database.testimonials.findUnique(query));
default:
return false;
}
@ -122,6 +134,9 @@ const markSubmissionReviewed = async(
case "staff":
await database.staff.delete(update);
break;
case "testimonials":
await database.testimonials.delete(update);
break;
default:
break;
}