Skip to content

Commit aeea2fa

Browse files
authored
Merge pull request #321 from quenti-io/staging
fix: assignment creation flow + available at handling
2 parents 61cc22c + 5d05f95 commit aeea2fa

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

apps/next/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@quenti/next",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"private": true,
55
"scripts": {
66
"build": "next build",

apps/next/src/modules/classes/pages/assignment-collab.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export const AssignmentCollab = () => {
5959
<Skeleton isLoaded={isLoaded} rounded="lg" fitContent alignSelf="end">
6060
<Button
6161
w="max"
62-
size="sm"
6362
rightIcon={<IconArrowRight size={18} />}
6463
isLoading={editCollab.isLoading}
6564
onClick={() => {

apps/next/src/modules/classes/pages/assignment-publish.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const AssignmentPublish = () => {
138138
</HStack>
139139
</Stack>
140140
{isLoaded ? (
141-
<EditorContent editor={editor} />
141+
assignment?.description && <EditorContent editor={editor} />
142142
) : (
143143
<SkeletonText noOfLines={3} skeletonHeight={4} spacing="3" />
144144
)}

packages/trpc/server/routers/assignments/feed.handler.ts

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const getStudent = async (
9898
classId,
9999
sectionId,
100100
published: true,
101+
availableAt: { lte: new Date() },
101102
...(query ? { title: { contains: query } } : {}),
102103
},
103104
select: {

packages/trpc/server/routers/assignments/get.handler.ts

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const getStudent = async (
157157
classId,
158158
},
159159
AND: {
160+
availableAt: { lte: new Date() },
160161
published: true,
161162
},
162163
},

packages/trpc/server/routers/study-sets/queries/collab.ts

+16
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ export const collabSelect = (userId?: string) =>
5050
export const assignmentArgs = (userId: string) =>
5151
Prisma.validator<Prisma.StudySet$assignmentArgs>()({
5252
where: {
53+
OR: [
54+
{
55+
availableAt: { lte: new Date() },
56+
},
57+
{
58+
class: {
59+
members: {
60+
some: {
61+
userId,
62+
deletedAt: null,
63+
type: "Teacher",
64+
},
65+
},
66+
},
67+
},
68+
],
5369
class: {
5470
members: {
5571
some: {

0 commit comments

Comments
 (0)