Skip to content

Commit 402d0d7

Browse files
committed
prettier format revert
1 parent 03712cd commit 402d0d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+137
-138
lines changed

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
"lint-staged": "^13.1.0",
9494
"nextjs-server-modules": "^4.7.0",
9595
"nodemailer-mock": "^2.0.1",
96-
"prettier": "^2.8.8",
9796
"rewiremock": "^3.14.5",
9897
"storybook": "^8.1.11",
9998
"testcontainers": "^9.8.0",

src/backend/auth/adapter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import { InsertObject, Selectable } from "kysely";
88

99
const mapStoredUserToAdapterUser = (
10-
user: Selectable<ZapatosTableNameToKyselySchema<"user">>,
10+
user: Selectable<ZapatosTableNameToKyselySchema<"user">>
1111
): AdapterUser => ({
1212
id: user.user_id,
1313
email: user.email,
@@ -17,7 +17,7 @@ const mapStoredUserToAdapterUser = (
1717
});
1818

1919
const mapStoredSessionToAdapterSession = (
20-
session: Selectable<ZapatosTableNameToKyselySchema<"session">>,
20+
session: Selectable<ZapatosTableNameToKyselySchema<"session">>
2121
): AdapterSession => ({
2222
sessionToken: session.session_token,
2323
userId: session.user_id,
@@ -32,7 +32,7 @@ const mapStoredSessionToAdapterSession = (
3232
* See https://next-auth.js.org/tutorials/creating-a-database-adapter
3333
*/
3434
export const createPersistedAuthAdapter = (
35-
db: KyselyDatabaseInstance,
35+
db: KyselyDatabaseInstance
3636
): Adapter => ({
3737
async createUser(user) {
3838
const numOfUsers = await db
@@ -149,7 +149,7 @@ export const createPersistedAuthAdapter = (
149149
.insertInto("account")
150150
.values(data)
151151
.onConflict((b) =>
152-
b.columns(["provider_name", "provider_account_id"]).doUpdateSet(data),
152+
b.columns(["provider_name", "provider_account_id"]).doUpdateSet(data)
153153
)
154154
.execute();
155155
},

src/backend/auth/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { KyselyDatabaseInstance } from "../lib";
44
import type { NextAuthOptions } from "next-auth";
55

66
export const getNextAuthOptions = (
7-
db: KyselyDatabaseInstance,
7+
db: KyselyDatabaseInstance
88
): NextAuthOptions => ({
99
providers: [
1010
GoogleProvider({

src/backend/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type tRPCContext = ReturnType<typeof getDb> & {
2323
};
2424

2525
export const createContext = async (
26-
options: CreateNextContextOptions,
26+
options: CreateNextContextOptions
2727
): Promise<tRPCContext> => {
2828
const env = (options.req.env as unknown as Env) ?? process.env;
2929
const {
@@ -40,7 +40,7 @@ export const createContext = async (
4040
const session = await getServerSession(
4141
options.req,
4242
options.res,
43-
getNextAuthOptions(db),
43+
getNextAuthOptions(db)
4444
);
4545
if (session && session.user?.email) {
4646
const user = await db

src/backend/db/lib/migrate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ interface MigrateOptions {
1111

1212
export const migrate = async (
1313
databaseUrl: string,
14-
{ silent = false, shouldGenerateTypes = true }: MigrateOptions = {},
14+
{ silent = false, shouldGenerateTypes = true }: MigrateOptions = {}
1515
) => {
1616
const migrationsDirectory = path.join(
1717
process.cwd(),
18-
"src/backend/db/migrations",
18+
"src/backend/db/migrations"
1919
);
2020
const zapatosDirectory = path.join(process.cwd(), "src/backend/db");
2121

src/backend/db/lib/seed.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test("seedfile works with current schema", async (t) => {
2020
t.fail(
2121
`Seedfile execution failed: ${
2222
error instanceof Error ? error.message : String(error)
23-
}`,
23+
}`
2424
);
2525
} finally {
2626
await db.destroy();

src/backend/lib/db_helpers/case_manager.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function createPara(
2020
case_manager_id: string,
2121
from_email: string,
2222
to_email: string,
23-
env: Env,
23+
env: Env
2424
): Promise<user.Selectable | undefined> {
2525
const { first_name, last_name, email } = para;
2626

@@ -48,7 +48,7 @@ export async function createPara(
4848
to_email,
4949
first_name,
5050
case_manager_id,
51-
env,
51+
env
5252
);
5353
}
5454

@@ -63,7 +63,7 @@ export async function sendInviteEmail(
6363
toEmail: string,
6464
first_name: string,
6565
caseManagerName: string,
66-
env: Env,
66+
env: Env
6767
): Promise<void> {
6868
await getTransporter(env).sendMail({
6969
from: fromEmail,
@@ -92,7 +92,7 @@ Thank you for the key role you play in improving student outcomes!`,
9292
export async function assignParaToCaseManager(
9393
para_id: string,
9494
case_manager_id: string,
95-
db: KyselyDatabaseInstance,
95+
db: KyselyDatabaseInstance
9696
): Promise<void> {
9797
await db
9898
.insertInto("paras_assigned_to_case_manager")
@@ -112,10 +112,10 @@ type createStudentProps = {
112112
};
113113

114114
export const STUDENT_ASSIGNED_TO_YOU_ERR = new Error(
115-
"This student is already assigned to you",
115+
"This student is already assigned to you"
116116
);
117117
export const STUDENT_ALREADY_ASSIGNED_ERR = new Error(
118-
"This student is already assigned to another case manager.",
118+
"This student is already assigned to another case manager."
119119
);
120120

121121
/**
@@ -164,7 +164,7 @@ export async function createAndAssignStudent({
164164
oc
165165
.column("email")
166166
.doUpdateSet({ assigned_case_manager_id: userId })
167-
.where("student.assigned_case_manager_id", "is", null),
167+
.where("student.assigned_case_manager_id", "is", null)
168168
)
169169
.returningAll()
170170
.executeTakeFirstOrThrow();

src/backend/lib/files.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { substituteTransactionOnContext } from "./utils/context";
44

55
const deleteFileWithoutTransaction = async (
66
fileId: string,
7-
ctx: tRPCContext,
7+
ctx: tRPCContext
88
) => {
99
if (ctx.auth.type === "none") {
1010
throw new Error("File deletion requires authentication.");
@@ -21,7 +21,7 @@ const deleteFileWithoutTransaction = async (
2121
new DeleteObjectCommand({
2222
Bucket: ctx.env.S3_USER_UPLOADS_BUCKET_NAME,
2323
Key: ext_s3_path,
24-
}),
24+
})
2525
);
2626
};
2727

@@ -33,7 +33,7 @@ export const deleteFile = async (fileId: string, ctx: tRPCContext) => {
3333
await ctx.db.transaction().execute(async (trx) => {
3434
await deleteFileWithoutTransaction(
3535
fileId,
36-
substituteTransactionOnContext(trx, ctx),
36+
substituteTransactionOnContext(trx, ctx)
3737
);
3838
});
3939
};

src/backend/lib/logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const logger = winston.createLogger({
99
winston.format.timestamp(),
1010
winston.format.printf(
1111
({ level, message, timestamp }) =>
12-
`${timestamp as string} ${level}: ${message as string}`,
13-
),
12+
`${timestamp as string} ${level}: ${message as string}`
13+
)
1414
),
1515
}),
1616
],

src/backend/lib/utils/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { KyselySchema } from "../types";
44

55
export const substituteTransactionOnContext = (
66
trx: Transaction<KyselySchema>,
7-
context: tRPCContext,
7+
context: tRPCContext
88
): tRPCContext => ({
99
...context,
1010
db: trx,

src/backend/routers/admin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { adminProcedure, router } from "../trpc";
44
export const admin = router({
55
getPostgresInfo: adminProcedure.query(async (req) => {
66
const result = await sql<{ version: string }>`SELECT version()`.execute(
7-
req.ctx.db,
7+
req.ctx.db
88
);
99

1010
return result.rows[0].version;

src/backend/routers/case_manager.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ test("addStudent - student doesn't exist in db", async (t) => {
9393
.selectFrom("student")
9494
.where("first_name", "=", "Foo")
9595
.selectAll()
96-
.executeTakeFirst(),
96+
.executeTakeFirst()
9797
);
9898

9999
await trpc.case_manager.addStudent.mutate({
@@ -119,7 +119,7 @@ test("addStudent - student exists in db but is unassigned", async (t) => {
119119
.selectFrom("student")
120120
.where("first_name", "=", seed.student.first_name)
121121
.selectAll()
122-
.executeTakeFirst(),
122+
.executeTakeFirst()
123123
);
124124

125125
await trpc.case_manager.addStudent.mutate({
@@ -138,7 +138,7 @@ test("addStudent - student exists in db but is unassigned", async (t) => {
138138
.where("student_id", "=", seed.student.student_id)
139139
.where("assigned_case_manager_id", "=", seed.case_manager.user_id)
140140
.selectAll()
141-
.executeTakeFirstOrThrow(),
141+
.executeTakeFirstOrThrow()
142142
);
143143
});
144144

@@ -167,7 +167,7 @@ test("addStudent - student exists in db and is already assigned to user", async
167167
last_name: seed.student.last_name,
168168
email: seed.student.email,
169169
grade: seed.student.grade,
170-
}),
170+
})
171171
);
172172

173173
t.is(err?.message, STUDENT_ASSIGNED_TO_YOU_ERR.message);
@@ -221,7 +221,7 @@ test("addStudent - student exists in db but is assigned to another case manager"
221221
last_name: newStudent.last_name,
222222
email: newStudent.email,
223223
grade: newStudent.grade,
224-
}),
224+
})
225225
);
226226

227227
t.is(err?.message, STUDENT_ALREADY_ASSIGNED_ERR.message);
@@ -241,7 +241,7 @@ test("addStudent - student exists in db but is assigned to another case manager"
241241
last_name: newStudent.last_name,
242242
email: newStudent.email,
243243
grade: newStudent.grade,
244-
}),
244+
})
245245
);
246246

247247
t.is(redundantErr?.message, STUDENT_ASSIGNED_TO_YOU_ERR.message);
@@ -258,7 +258,7 @@ test("addStudent - invalid email", async (t) => {
258258
last_name: "Bar",
259259
email: "invalid-email",
260260
grade: 6,
261-
}),
261+
})
262262
);
263263
// should be zod error
264264
t.is(typeof err?.message, "string");

0 commit comments

Comments
 (0)