Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5bc7f0a
feat(clubInfo): check if the user is president
at-wr Apr 15, 2024
6b7d175
feat(clubInfo): add component `ViewClubInfo`
at-wr Apr 15, 2024
09557f2
feat(clubInfo): add edit page for club details
at-wr Apr 15, 2024
9ad63f7
feat(clubInfo): add clubInfo section for /cas/clubs/[id]
at-wr Apr 15, 2024
8bdaa8e
fix(ESLint): fix style/indent
at-wr Apr 15, 2024
5ea0d8d
fix(LeaveRequest): fix excessive stack depth
at-wr Apr 15, 2024
4c8f3fe
fix(LeaveRequest): fix excessive stack depth
at-wr Apr 15, 2024
8f5f1f8
feat(clubInfo): add edit and ViewClubInfo components to club page
at-wr Apr 16, 2024
3fb2009
fix(clubInfo): permission error
at-wr Apr 16, 2024
dfb6d45
feat(clubInfo): judge if the supervisor have nickname
at-wr Apr 16, 2024
1e9569f
fix(clubInfo): fix privilege api method
at-wr Apr 16, 2024
a9f1cef
feat(clubInfo): show 404 when `isPresident` is false
at-wr Apr 16, 2024
4565e08
fix(clubInfo): let title
at-wr Apr 16, 2024
d1cf356
feat(clubInfo): only show `ViewClubInfo` if the club still exists
at-wr Apr 16, 2024
cc3342c
style(clubInfo): unify club information space style
at-wr Apr 16, 2024
87a4d64
style(clubInfo): unify club information space style
at-wr Apr 16, 2024
3fd4fde
refactor: use `user/all_clubs` for getting editable clubs
qwerzl Apr 19, 2024
0603640
refactor: use `user/all_clubs` for getting editable clubs
qwerzl Apr 19, 2024
16d7593
feat(clubInfo): add dialog for editing club info
at-wr May 9, 2024
cb967b0
feat(clubInfo): display QR Code in ViewClubInfo
at-wr May 9, 2024
4b45f36
feat: add some packages
at-wr May 9, 2024
30b3c14
fix: remove test condition
at-wr May 11, 2024
ae3bf1a
feat(club): show club name in title
at-wr May 20, 2024
cfc3b3f
chore: update pnpm-lock
at-wr May 20, 2024
699bfba
feat: teacher hover card
at-wr May 20, 2024
4be6f0a
style: add underline when hovered
at-wr May 20, 2024
45e408f
style: add hover placeholder for club members
at-wr May 20, 2024
cb53a39
feat: add found time for club info
at-wr May 20, 2024
eeedbdf
feat: add Open Graph meta data
at-wr May 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(ESLint): fix style/indent
  • Loading branch information
at-wr committed Apr 15, 2024
commit 8bdaa8e56862ccc6ac2781989dce1b3800c73bc8
24 changes: 12 additions & 12 deletions pages/cas/clubs/[id]/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const id = route.params.id // Fetch current Club ID via route params

// Filter clubs based on C_GroupsID and include information at the same level as groups
const filteredClubs = Object.values(clubs).flatMap(clubCategory =>
clubCategory.filter((club: Club) =>
club.groups.some(group => group.C_GroupsID === id),
).map((club: Club) => ({
...club, // Spread to include all same-level information
groups: club.groups.filter(group => group.C_GroupsID === id), // Filter groups to only include those that match the ID
})),
clubCategory.filter((club: Club) =>
club.groups.some(group => group.C_GroupsID === id),
).map((club: Club) => ({
...club, // Spread to include all same-level information
groups: club.groups.filter(group => group.C_GroupsID === id), // Filter groups to only include those that match the ID
})),
) as Club[]

const { toast } = useToast()
Expand Down Expand Up @@ -99,11 +99,11 @@ const onSubmit = handleSubmit(async (values) => {
<PopoverTrigger as-child>
<FormControl>
<Button
:class="cn(
:class="cn(
'w-full ps-3 text-start font-normal',
!value && 'text-muted-foreground',
)" variant="outline"
:disabled="isLoading"
:disabled="isLoading"
>
<span>{{ value ? format(value, "PPP") : "选择日期..." }}</span>
<Icon class="ms-auto opacity-50" name="material-symbols:calendar-today-outline" />
Expand All @@ -123,10 +123,10 @@ const onSubmit = handleSubmit(async (values) => {
<FormLabel>WeChat Group URL</FormLabel>
<FormControl>
<Textarea
class="resize-none"
placeholder="WeChat Group URL"
v-bind="componentField"
:disabled="isLoading"
class="resize-none"
placeholder="WeChat Group URL"
v-bind="componentField"
:disabled="isLoading"
/>
</FormControl>
<FormMessage />
Expand Down
38 changes: 19 additions & 19 deletions server/api/cas/info/privilege.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ import * as z from 'zod'
const prisma = new PrismaClient()

const requestSchema = z.object({
clubId: z.number(),
clubId: z.number(),
})

export default eventHandler(async (event) => {
const { auth } = event.context
const { auth } = event.context

if (!auth.userId) {
setResponseStatus(event, 403)
return
}
if (!auth.userId) {
setResponseStatus(event, 403)
return
}

const tsimsStudentId = (await prisma.user.findUnique({
where: {
id: auth.userId,
},
}))!.tsimsStudentId
const tsimsStudentId = (await prisma.user.findUnique({
where: {
id: auth.userId,
},
}))!.tsimsStudentId

const requestBody = await readValidatedBody(event, body => requestSchema.parse(body))
const requestBody = await readValidatedBody(event, body => requestSchema.parse(body))

const club = (await prisma.club.findFirst({
where: {
id: requestBody.clubId,
presidentByTsimsStudentId: tsimsStudentId,
},
}))
const club = (await prisma.club.findFirst({
where: {
id: requestBody.clubId,
presidentByTsimsStudentId: tsimsStudentId,
},
}))

return !!club
return !!club
})