@studious-lms/server 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routers/_app.d.ts +256 -4
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/assignment.d.ts +86 -0
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/assignment.js +57 -0
- package/dist/routers/class.d.ts +10 -0
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +1 -0
- package/dist/routers/event.d.ts +2 -0
- package/dist/routers/event.d.ts.map +1 -1
- package/dist/routers/folder.d.ts +13 -2
- package/dist/routers/folder.d.ts.map +1 -1
- package/dist/routers/folder.js +19 -6
- package/dist/routers/section.d.ts +17 -0
- package/dist/routers/section.d.ts.map +1 -1
- package/dist/routers/section.js +73 -0
- package/package.json +1 -1
- package/prisma/migrations/20250919063704_init2/migration.sql +24 -0
- package/prisma/schema.prisma +5 -0
- package/src/routers/assignment.ts +90 -12
- package/src/routers/class.ts +2 -1
- package/src/routers/folder.ts +19 -6
- package/src/routers/section.ts +86 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_app.d.ts","sourceRoot":"","sources":["../../src/routers/_app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAU1E,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"_app.d.ts","sourceRoot":"","sources":["../../src/routers/_app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAU1E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAC"}
|
|
@@ -16,6 +16,66 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
16
16
|
};
|
|
17
17
|
transformer: false;
|
|
18
18
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
19
|
+
order: import("@trpc/server").TRPCMutationProcedure<{
|
|
20
|
+
input: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
classId: string;
|
|
23
|
+
id: string;
|
|
24
|
+
order: number;
|
|
25
|
+
};
|
|
26
|
+
output: {
|
|
27
|
+
type: import(".prisma/client").$Enums.AssignmentType;
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
dueDate: Date;
|
|
31
|
+
maxGrade: number | null;
|
|
32
|
+
classId: string;
|
|
33
|
+
eventId: string | null;
|
|
34
|
+
markSchemeId: string | null;
|
|
35
|
+
gradingBoundaryId: string | null;
|
|
36
|
+
instructions: string;
|
|
37
|
+
weight: number;
|
|
38
|
+
graded: boolean;
|
|
39
|
+
sectionId: string | null;
|
|
40
|
+
template: boolean;
|
|
41
|
+
createdAt: Date | null;
|
|
42
|
+
modifiedAt: Date | null;
|
|
43
|
+
teacherId: string;
|
|
44
|
+
inProgress: boolean;
|
|
45
|
+
order: number | null;
|
|
46
|
+
};
|
|
47
|
+
meta: object;
|
|
48
|
+
}>;
|
|
49
|
+
move: import("@trpc/server").TRPCMutationProcedure<{
|
|
50
|
+
input: {
|
|
51
|
+
[x: string]: unknown;
|
|
52
|
+
classId: string;
|
|
53
|
+
id: string;
|
|
54
|
+
targetSectionId: string;
|
|
55
|
+
};
|
|
56
|
+
output: {
|
|
57
|
+
type: import(".prisma/client").$Enums.AssignmentType;
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
dueDate: Date;
|
|
61
|
+
maxGrade: number | null;
|
|
62
|
+
classId: string;
|
|
63
|
+
eventId: string | null;
|
|
64
|
+
markSchemeId: string | null;
|
|
65
|
+
gradingBoundaryId: string | null;
|
|
66
|
+
instructions: string;
|
|
67
|
+
weight: number;
|
|
68
|
+
graded: boolean;
|
|
69
|
+
sectionId: string | null;
|
|
70
|
+
template: boolean;
|
|
71
|
+
createdAt: Date | null;
|
|
72
|
+
modifiedAt: Date | null;
|
|
73
|
+
teacherId: string;
|
|
74
|
+
inProgress: boolean;
|
|
75
|
+
order: number | null;
|
|
76
|
+
};
|
|
77
|
+
meta: object;
|
|
78
|
+
}>;
|
|
19
79
|
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
20
80
|
input: {
|
|
21
81
|
title: string;
|
|
@@ -110,7 +170,9 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
110
170
|
section: {
|
|
111
171
|
id: string;
|
|
112
172
|
name: string;
|
|
173
|
+
color: string | null;
|
|
113
174
|
classId: string;
|
|
175
|
+
order: number | null;
|
|
114
176
|
} | null;
|
|
115
177
|
title: string;
|
|
116
178
|
dueDate: Date;
|
|
@@ -237,6 +299,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
237
299
|
modifiedAt: Date | null;
|
|
238
300
|
teacherId: string;
|
|
239
301
|
inProgress: boolean;
|
|
302
|
+
order: number | null;
|
|
240
303
|
};
|
|
241
304
|
meta: object;
|
|
242
305
|
}>;
|
|
@@ -284,6 +347,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
284
347
|
modifiedAt: Date | null;
|
|
285
348
|
teacherId: string;
|
|
286
349
|
inProgress: boolean;
|
|
350
|
+
order: number | null;
|
|
287
351
|
};
|
|
288
352
|
student: {
|
|
289
353
|
id: string;
|
|
@@ -327,6 +391,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
327
391
|
createdAt: Date;
|
|
328
392
|
modifiedAt: Date;
|
|
329
393
|
rubricState: string | null;
|
|
394
|
+
teacherComments: string | null;
|
|
330
395
|
submittedAt: Date | null;
|
|
331
396
|
submitted: boolean | null;
|
|
332
397
|
returned: boolean | null;
|
|
@@ -369,6 +434,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
369
434
|
modifiedAt: Date | null;
|
|
370
435
|
teacherId: string;
|
|
371
436
|
inProgress: boolean;
|
|
437
|
+
order: number | null;
|
|
372
438
|
};
|
|
373
439
|
student: {
|
|
374
440
|
id: string;
|
|
@@ -411,6 +477,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
411
477
|
createdAt: Date;
|
|
412
478
|
modifiedAt: Date;
|
|
413
479
|
rubricState: string | null;
|
|
480
|
+
teacherComments: string | null;
|
|
414
481
|
submittedAt: Date | null;
|
|
415
482
|
submitted: boolean | null;
|
|
416
483
|
returned: boolean | null;
|
|
@@ -462,6 +529,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
462
529
|
modifiedAt: Date | null;
|
|
463
530
|
teacherId: string;
|
|
464
531
|
inProgress: boolean;
|
|
532
|
+
order: number | null;
|
|
465
533
|
};
|
|
466
534
|
student: {
|
|
467
535
|
id: string;
|
|
@@ -504,6 +572,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
504
572
|
createdAt: Date;
|
|
505
573
|
modifiedAt: Date;
|
|
506
574
|
rubricState: string | null;
|
|
575
|
+
teacherComments: string | null;
|
|
507
576
|
submittedAt: Date | null;
|
|
508
577
|
submitted: boolean | null;
|
|
509
578
|
returned: boolean | null;
|
|
@@ -564,6 +633,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
564
633
|
modifiedAt: Date | null;
|
|
565
634
|
teacherId: string;
|
|
566
635
|
inProgress: boolean;
|
|
636
|
+
order: number | null;
|
|
567
637
|
};
|
|
568
638
|
student: {
|
|
569
639
|
id: string;
|
|
@@ -592,6 +662,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
592
662
|
createdAt: Date;
|
|
593
663
|
modifiedAt: Date;
|
|
594
664
|
rubricState: string | null;
|
|
665
|
+
teacherComments: string | null;
|
|
595
666
|
submittedAt: Date | null;
|
|
596
667
|
submitted: boolean | null;
|
|
597
668
|
returned: boolean | null;
|
|
@@ -643,6 +714,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
643
714
|
modifiedAt: Date | null;
|
|
644
715
|
teacherId: string;
|
|
645
716
|
inProgress: boolean;
|
|
717
|
+
order: number | null;
|
|
646
718
|
};
|
|
647
719
|
student: {
|
|
648
720
|
id: string;
|
|
@@ -686,6 +758,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
686
758
|
createdAt: Date;
|
|
687
759
|
modifiedAt: Date;
|
|
688
760
|
rubricState: string | null;
|
|
761
|
+
teacherComments: string | null;
|
|
689
762
|
submittedAt: Date | null;
|
|
690
763
|
submitted: boolean | null;
|
|
691
764
|
returned: boolean | null;
|
|
@@ -753,6 +826,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
753
826
|
modifiedAt: Date | null;
|
|
754
827
|
teacherId: string;
|
|
755
828
|
inProgress: boolean;
|
|
829
|
+
order: number | null;
|
|
756
830
|
};
|
|
757
831
|
student: {
|
|
758
832
|
id: string;
|
|
@@ -781,6 +855,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
781
855
|
createdAt: Date;
|
|
782
856
|
modifiedAt: Date;
|
|
783
857
|
rubricState: string | null;
|
|
858
|
+
teacherComments: string | null;
|
|
784
859
|
submittedAt: Date | null;
|
|
785
860
|
submitted: boolean | null;
|
|
786
861
|
returned: boolean | null;
|
|
@@ -834,6 +909,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
834
909
|
modifiedAt: Date | null;
|
|
835
910
|
teacherId: string;
|
|
836
911
|
inProgress: boolean;
|
|
912
|
+
order: number | null;
|
|
837
913
|
};
|
|
838
914
|
};
|
|
839
915
|
meta: object;
|
|
@@ -884,6 +960,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
884
960
|
modifiedAt: Date | null;
|
|
885
961
|
teacherId: string;
|
|
886
962
|
inProgress: boolean;
|
|
963
|
+
order: number | null;
|
|
887
964
|
};
|
|
888
965
|
};
|
|
889
966
|
meta: object;
|
|
@@ -933,7 +1010,9 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
933
1010
|
section: {
|
|
934
1011
|
id: string;
|
|
935
1012
|
name: string;
|
|
1013
|
+
color: string | null;
|
|
936
1014
|
classId: string;
|
|
1015
|
+
order: number | null;
|
|
937
1016
|
} | null;
|
|
938
1017
|
teacher: {
|
|
939
1018
|
id: string;
|
|
@@ -995,6 +1074,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
995
1074
|
modifiedAt: Date | null;
|
|
996
1075
|
teacherId: string;
|
|
997
1076
|
inProgress: boolean;
|
|
1077
|
+
order: number | null;
|
|
998
1078
|
};
|
|
999
1079
|
meta: object;
|
|
1000
1080
|
}>;
|
|
@@ -1008,7 +1088,9 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1008
1088
|
section: {
|
|
1009
1089
|
id: string;
|
|
1010
1090
|
name: string;
|
|
1091
|
+
color: string | null;
|
|
1011
1092
|
classId: string;
|
|
1093
|
+
order: number | null;
|
|
1012
1094
|
} | null;
|
|
1013
1095
|
teacher: {
|
|
1014
1096
|
id: string;
|
|
@@ -1070,6 +1152,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1070
1152
|
modifiedAt: Date | null;
|
|
1071
1153
|
teacherId: string;
|
|
1072
1154
|
inProgress: boolean;
|
|
1155
|
+
order: number | null;
|
|
1073
1156
|
};
|
|
1074
1157
|
meta: object;
|
|
1075
1158
|
}>;
|
|
@@ -1084,7 +1167,9 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1084
1167
|
section: {
|
|
1085
1168
|
id: string;
|
|
1086
1169
|
name: string;
|
|
1170
|
+
color: string | null;
|
|
1087
1171
|
classId: string;
|
|
1172
|
+
order: number | null;
|
|
1088
1173
|
} | null;
|
|
1089
1174
|
teacher: {
|
|
1090
1175
|
id: string;
|
|
@@ -1146,6 +1231,7 @@ export declare const assignmentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1146
1231
|
modifiedAt: Date | null;
|
|
1147
1232
|
teacherId: string;
|
|
1148
1233
|
inProgress: boolean;
|
|
1234
|
+
order: number | null;
|
|
1149
1235
|
};
|
|
1150
1236
|
meta: object;
|
|
1151
1237
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignment.d.ts","sourceRoot":"","sources":["../../src/routers/assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqFxB,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"assignment.d.ts","sourceRoot":"","sources":["../../src/routers/assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqFxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAioD3B,CAAC"}
|
|
@@ -76,6 +76,45 @@ const updateSubmissionSchema = z.object({
|
|
|
76
76
|
})).optional(),
|
|
77
77
|
});
|
|
78
78
|
export const assignmentRouter = createTRPCRouter({
|
|
79
|
+
order: protectedTeacherProcedure
|
|
80
|
+
.input(z.object({
|
|
81
|
+
id: z.string(),
|
|
82
|
+
classId: z.string(),
|
|
83
|
+
order: z.number(),
|
|
84
|
+
}))
|
|
85
|
+
.mutation(async ({ ctx, input }) => {
|
|
86
|
+
const { id, order } = input;
|
|
87
|
+
const assignment = await prisma.assignment.update({
|
|
88
|
+
where: { id },
|
|
89
|
+
data: { order },
|
|
90
|
+
});
|
|
91
|
+
return assignment;
|
|
92
|
+
}),
|
|
93
|
+
move: protectedTeacherProcedure
|
|
94
|
+
.input(z.object({
|
|
95
|
+
id: z.string(),
|
|
96
|
+
classId: z.string(),
|
|
97
|
+
targetSectionId: z.string(),
|
|
98
|
+
}))
|
|
99
|
+
.mutation(async ({ ctx, input }) => {
|
|
100
|
+
const { id, targetSectionId, } = input;
|
|
101
|
+
const assignments = await prisma.assignment.findMany({
|
|
102
|
+
where: { sectionId: targetSectionId },
|
|
103
|
+
});
|
|
104
|
+
const stack = assignments.sort((a, b) => (a.order || 0) - (b.order || 0)).map((assignment, index) => ({
|
|
105
|
+
id: assignment.id,
|
|
106
|
+
order: index + 1,
|
|
107
|
+
})).map((assignment) => ({
|
|
108
|
+
where: { id: assignment.id },
|
|
109
|
+
data: { order: assignment.order },
|
|
110
|
+
}));
|
|
111
|
+
await Promise.all(stack.map(({ where, data }) => prisma.assignment.update({ where, data })));
|
|
112
|
+
const assignment = await prisma.assignment.update({
|
|
113
|
+
where: { id },
|
|
114
|
+
data: { sectionId: targetSectionId, order: 0 },
|
|
115
|
+
});
|
|
116
|
+
return assignment;
|
|
117
|
+
}),
|
|
79
118
|
create: protectedProcedure
|
|
80
119
|
.input(createAssignmentSchema)
|
|
81
120
|
.mutation(async ({ ctx, input }) => {
|
|
@@ -117,6 +156,22 @@ export const assignmentRouter = createTRPCRouter({
|
|
|
117
156
|
}, 0);
|
|
118
157
|
}
|
|
119
158
|
console.log(markSchemeId, gradingBoundaryId);
|
|
159
|
+
// find all assignments in the section it is in (or none) and reorder them
|
|
160
|
+
const assignments = await prisma.assignment.findMany({
|
|
161
|
+
where: {
|
|
162
|
+
classId: classId,
|
|
163
|
+
...(sectionId && {
|
|
164
|
+
sectionId: sectionId,
|
|
165
|
+
}),
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
const stack = assignments.sort((a, b) => (a.order || 0) - (b.order || 0)).map((assignment, index) => ({
|
|
169
|
+
id: assignment.id,
|
|
170
|
+
order: index + 1,
|
|
171
|
+
})).map((assignment) => ({
|
|
172
|
+
where: { id: assignment.id },
|
|
173
|
+
data: { order: assignment.order },
|
|
174
|
+
}));
|
|
120
175
|
// Create assignment with submissions for all students
|
|
121
176
|
const assignment = await prisma.assignment.create({
|
|
122
177
|
data: {
|
|
@@ -127,6 +182,7 @@ export const assignmentRouter = createTRPCRouter({
|
|
|
127
182
|
graded,
|
|
128
183
|
weight,
|
|
129
184
|
type,
|
|
185
|
+
order: 0,
|
|
130
186
|
inProgress: inProgress || false,
|
|
131
187
|
class: {
|
|
132
188
|
connect: { id: classId }
|
|
@@ -193,6 +249,7 @@ export const assignmentRouter = createTRPCRouter({
|
|
|
193
249
|
}
|
|
194
250
|
}
|
|
195
251
|
});
|
|
252
|
+
await Promise.all(stack.map(({ where, data }) => prisma.assignment.update({ where, data })));
|
|
196
253
|
// Upload files if provided
|
|
197
254
|
let uploadedFiles = [];
|
|
198
255
|
if (files && files.length > 0) {
|
package/dist/routers/class.d.ts
CHANGED
|
@@ -65,7 +65,9 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
65
65
|
sections: {
|
|
66
66
|
id: string;
|
|
67
67
|
name: string;
|
|
68
|
+
color: string | null;
|
|
68
69
|
classId: string;
|
|
70
|
+
order: number | null;
|
|
69
71
|
}[];
|
|
70
72
|
assignments: {
|
|
71
73
|
late: boolean;
|
|
@@ -92,6 +94,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
92
94
|
graded: boolean;
|
|
93
95
|
createdAt: Date | null;
|
|
94
96
|
inProgress: boolean;
|
|
97
|
+
order: number | null;
|
|
95
98
|
markScheme: {
|
|
96
99
|
id: string;
|
|
97
100
|
structured: string;
|
|
@@ -307,6 +310,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
307
310
|
createdAt: Date;
|
|
308
311
|
modifiedAt: Date;
|
|
309
312
|
rubricState: string | null;
|
|
313
|
+
teacherComments: string | null;
|
|
310
314
|
submittedAt: Date | null;
|
|
311
315
|
submitted: boolean | null;
|
|
312
316
|
returned: boolean | null;
|
|
@@ -337,6 +341,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
337
341
|
createdAt: Date;
|
|
338
342
|
modifiedAt: Date;
|
|
339
343
|
rubricState: string | null;
|
|
344
|
+
teacherComments: string | null;
|
|
340
345
|
submittedAt: Date | null;
|
|
341
346
|
submitted: boolean | null;
|
|
342
347
|
returned: boolean | null;
|
|
@@ -520,6 +525,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
520
525
|
modifiedAt: Date | null;
|
|
521
526
|
teacherId: string;
|
|
522
527
|
inProgress: boolean;
|
|
528
|
+
order: number | null;
|
|
523
529
|
}[];
|
|
524
530
|
meta: object;
|
|
525
531
|
}>;
|
|
@@ -557,6 +563,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
557
563
|
modifiedAt: Date | null;
|
|
558
564
|
teacherId: string;
|
|
559
565
|
inProgress: boolean;
|
|
566
|
+
order: number | null;
|
|
560
567
|
};
|
|
561
568
|
meta: object;
|
|
562
569
|
}>;
|
|
@@ -594,6 +601,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
594
601
|
modifiedAt: Date | null;
|
|
595
602
|
teacherId: string;
|
|
596
603
|
inProgress: boolean;
|
|
604
|
+
order: number | null;
|
|
597
605
|
};
|
|
598
606
|
meta: object;
|
|
599
607
|
}>;
|
|
@@ -622,6 +630,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
622
630
|
modifiedAt: Date | null;
|
|
623
631
|
teacherId: string;
|
|
624
632
|
inProgress: boolean;
|
|
633
|
+
order: number | null;
|
|
625
634
|
};
|
|
626
635
|
meta: object;
|
|
627
636
|
}>;
|
|
@@ -654,6 +663,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
654
663
|
modifiedAt: Date | null;
|
|
655
664
|
teacherId: string;
|
|
656
665
|
inProgress: boolean;
|
|
666
|
+
order: number | null;
|
|
657
667
|
};
|
|
658
668
|
meta: object;
|
|
659
669
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../src/routers/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../src/routers/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4hCtB,CAAC"}
|
package/dist/routers/class.js
CHANGED
package/dist/routers/event.d.ts
CHANGED
|
@@ -183,6 +183,7 @@ export declare const eventRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
183
183
|
modifiedAt: Date | null;
|
|
184
184
|
teacherId: string;
|
|
185
185
|
inProgress: boolean;
|
|
186
|
+
order: number | null;
|
|
186
187
|
};
|
|
187
188
|
};
|
|
188
189
|
meta: object;
|
|
@@ -226,6 +227,7 @@ export declare const eventRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
226
227
|
modifiedAt: Date | null;
|
|
227
228
|
teacherId: string;
|
|
228
229
|
inProgress: boolean;
|
|
230
|
+
order: number | null;
|
|
229
231
|
};
|
|
230
232
|
};
|
|
231
233
|
meta: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/routers/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/routers/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4etB,CAAC"}
|
package/dist/routers/folder.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
21
21
|
[x: string]: unknown;
|
|
22
22
|
classId: string;
|
|
23
23
|
name: string;
|
|
24
|
+
color?: string | undefined;
|
|
24
25
|
parentFolderId?: string | undefined;
|
|
25
26
|
};
|
|
26
27
|
output: {
|
|
@@ -46,6 +47,7 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
46
47
|
} & {
|
|
47
48
|
id: string;
|
|
48
49
|
name: string;
|
|
50
|
+
color: string | null;
|
|
49
51
|
classId: string | null;
|
|
50
52
|
parentFolderId: string | null;
|
|
51
53
|
};
|
|
@@ -84,6 +86,7 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
84
86
|
} & {
|
|
85
87
|
id: string;
|
|
86
88
|
name: string;
|
|
89
|
+
color: string | null;
|
|
87
90
|
classId: string | null;
|
|
88
91
|
parentFolderId: string | null;
|
|
89
92
|
};
|
|
@@ -117,6 +120,7 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
117
120
|
} & {
|
|
118
121
|
id: string;
|
|
119
122
|
name: string;
|
|
123
|
+
color: string | null;
|
|
120
124
|
classId: string | null;
|
|
121
125
|
parentFolderId: string | null;
|
|
122
126
|
})[];
|
|
@@ -147,10 +151,12 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
147
151
|
childFolders: number;
|
|
148
152
|
};
|
|
149
153
|
name: string;
|
|
154
|
+
color: string | null;
|
|
150
155
|
}[];
|
|
151
156
|
} & {
|
|
152
157
|
id: string;
|
|
153
158
|
name: string;
|
|
159
|
+
color: string | null;
|
|
154
160
|
classId: string | null;
|
|
155
161
|
parentFolderId: string | null;
|
|
156
162
|
})[];
|
|
@@ -179,6 +185,7 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
179
185
|
id: string;
|
|
180
186
|
}[];
|
|
181
187
|
name: string;
|
|
188
|
+
color: string | null;
|
|
182
189
|
childFolders: {
|
|
183
190
|
id: string;
|
|
184
191
|
}[];
|
|
@@ -186,6 +193,7 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
186
193
|
} & {
|
|
187
194
|
id: string;
|
|
188
195
|
name: string;
|
|
196
|
+
color: string | null;
|
|
189
197
|
classId: string | null;
|
|
190
198
|
parentFolderId: string | null;
|
|
191
199
|
}) | null;
|
|
@@ -252,17 +260,19 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
252
260
|
} & {
|
|
253
261
|
id: string;
|
|
254
262
|
name: string;
|
|
263
|
+
color: string | null;
|
|
255
264
|
classId: string | null;
|
|
256
265
|
parentFolderId: string | null;
|
|
257
266
|
};
|
|
258
267
|
meta: object;
|
|
259
268
|
}>;
|
|
260
|
-
|
|
269
|
+
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
261
270
|
input: {
|
|
262
271
|
[x: string]: unknown;
|
|
263
272
|
classId: string;
|
|
273
|
+
name: string;
|
|
264
274
|
folderId: string;
|
|
265
|
-
|
|
275
|
+
color?: string | undefined;
|
|
266
276
|
};
|
|
267
277
|
output: {
|
|
268
278
|
files: {
|
|
@@ -287,6 +297,7 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
287
297
|
} & {
|
|
288
298
|
id: string;
|
|
289
299
|
name: string;
|
|
300
|
+
color: string | null;
|
|
290
301
|
classId: string | null;
|
|
291
302
|
parentFolderId: string | null;
|
|
292
303
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/routers/folder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/routers/folder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmuBvB,CAAC"}
|
package/dist/routers/folder.js
CHANGED
|
@@ -12,6 +12,7 @@ const fileSchema = z.object({
|
|
|
12
12
|
const createFolderSchema = z.object({
|
|
13
13
|
name: z.string(),
|
|
14
14
|
parentFolderId: z.string().optional(),
|
|
15
|
+
color: z.string().optional(),
|
|
15
16
|
});
|
|
16
17
|
const uploadFilesToFolderSchema = z.object({
|
|
17
18
|
folderId: z.string(),
|
|
@@ -24,7 +25,7 @@ export const folderRouter = createTRPCRouter({
|
|
|
24
25
|
create: protectedTeacherProcedure
|
|
25
26
|
.input(createFolderSchema)
|
|
26
27
|
.mutation(async ({ ctx, input }) => {
|
|
27
|
-
const { classId, name } = input;
|
|
28
|
+
const { classId, name, color } = input;
|
|
28
29
|
let parentFolderId = input.parentFolderId || null;
|
|
29
30
|
if (!ctx.user) {
|
|
30
31
|
throw new TRPCError({
|
|
@@ -65,6 +66,9 @@ export const folderRouter = createTRPCRouter({
|
|
|
65
66
|
class: {
|
|
66
67
|
connect: { id: classId },
|
|
67
68
|
},
|
|
69
|
+
...(color && {
|
|
70
|
+
color: color,
|
|
71
|
+
}),
|
|
68
72
|
},
|
|
69
73
|
});
|
|
70
74
|
}
|
|
@@ -92,6 +96,9 @@ export const folderRouter = createTRPCRouter({
|
|
|
92
96
|
connect: { id: parentFolderId },
|
|
93
97
|
},
|
|
94
98
|
}),
|
|
99
|
+
...(color && {
|
|
100
|
+
color: color,
|
|
101
|
+
}),
|
|
95
102
|
},
|
|
96
103
|
include: {
|
|
97
104
|
files: {
|
|
@@ -293,6 +300,7 @@ export const folderRouter = createTRPCRouter({
|
|
|
293
300
|
select: {
|
|
294
301
|
id: true,
|
|
295
302
|
name: true,
|
|
303
|
+
color: true,
|
|
296
304
|
_count: {
|
|
297
305
|
select: {
|
|
298
306
|
files: true,
|
|
@@ -362,6 +370,7 @@ export const folderRouter = createTRPCRouter({
|
|
|
362
370
|
select: {
|
|
363
371
|
id: true,
|
|
364
372
|
name: true,
|
|
373
|
+
color: true,
|
|
365
374
|
files: {
|
|
366
375
|
select: {
|
|
367
376
|
id: true,
|
|
@@ -625,14 +634,15 @@ export const folderRouter = createTRPCRouter({
|
|
|
625
634
|
});
|
|
626
635
|
return updatedFolder;
|
|
627
636
|
}),
|
|
628
|
-
|
|
637
|
+
update: protectedTeacherProcedure
|
|
629
638
|
.input(z.object({
|
|
630
639
|
folderId: z.string(),
|
|
631
|
-
|
|
640
|
+
name: z.string(),
|
|
641
|
+
color: z.string().optional(),
|
|
632
642
|
classId: z.string(),
|
|
633
643
|
}))
|
|
634
644
|
.mutation(async ({ ctx, input }) => {
|
|
635
|
-
const { folderId,
|
|
645
|
+
const { folderId, name, color, classId } = input;
|
|
636
646
|
// Get the folder
|
|
637
647
|
const folder = await prisma.folder.findFirst({
|
|
638
648
|
where: {
|
|
@@ -646,7 +656,7 @@ export const folderRouter = createTRPCRouter({
|
|
|
646
656
|
});
|
|
647
657
|
}
|
|
648
658
|
// Validate new name
|
|
649
|
-
if (!
|
|
659
|
+
if (!name.trim()) {
|
|
650
660
|
throw new TRPCError({
|
|
651
661
|
code: "BAD_REQUEST",
|
|
652
662
|
message: "Folder name cannot be empty",
|
|
@@ -656,7 +666,10 @@ export const folderRouter = createTRPCRouter({
|
|
|
656
666
|
const updatedFolder = await prisma.folder.update({
|
|
657
667
|
where: { id: folderId },
|
|
658
668
|
data: {
|
|
659
|
-
name:
|
|
669
|
+
name: name.trim(),
|
|
670
|
+
...(color && {
|
|
671
|
+
color: color,
|
|
672
|
+
}),
|
|
660
673
|
},
|
|
661
674
|
include: {
|
|
662
675
|
files: {
|