Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions app/pages/staff.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ zh:
finance: 財務組
service: 場務組
production: 製播組
UCA: UCA
en:
noStaff: The staff information has not been announced yet.
meta:
Expand All @@ -91,4 +92,5 @@ en:
finance: Finance
service: Service
production: Production
UCA: UCA
</i18n>
2 changes: 1 addition & 1 deletion server/api/sheets/[sheet].get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineCachedEventHandler(
const { sheet } = await getValidatedRouterParams(event, requestSchema.parse)
const name = SHEET_NAMES[sheet]

const url = `https://docs.google.com/spreadsheets/d/${googleSheetId}/gviz/tq?tqx=out:csv&sheet=${encodeURIComponent(name)}`
const url = `https://docs.google.com/spreadsheets/d/${googleSheetId}/gviz/tq?tqx=out:csv&sheet=${encodeURIComponent(name)}&headers=1`
const csv = await $fetch<string>(url, { responseType: 'text' })
const records = parse(csv, { columns: true, skip_empty_lines: true })
return records
Expand Down
5 changes: 3 additions & 2 deletions shared/types/staff.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { z } from 'zod'

export const STAFF_GROUP_NAMES = ['總召組', '行政組', '議程組', '贊助組', '交流組', '公關組', '資訊組', '設計組', '紀錄組', '財務組', '場務組', '製播組'] as const
export const STAFF_GROUP_NAMES = ['總召組', '行政組', '議程組', '贊助組', '交流組', '公關組', '資訊組', '設計組', '紀錄組', '財務組', '場務組', '製播組', 'UCA'] as const
export const StaffGroupNameSchema = z.enum(STAFF_GROUP_NAMES)
export type StaffGroupName = z.infer<typeof StaffGroupNameSchema>

export const STAFF_GROUP_KEYS = ['coordinator', 'secretary', 'program', 'sponsorship', 'engagement', 'pr', 'it', 'design', 'documentary', 'finance', 'service', 'production'] as const
export const STAFF_GROUP_KEYS = ['coordinator', 'secretary', 'program', 'sponsorship', 'engagement', 'pr', 'it', 'design', 'documentary', 'finance', 'service', 'production', 'UCA'] as const
export const StaffGroupKeySchema = z.enum(STAFF_GROUP_KEYS)
export type StaffGroupKey = z.infer<typeof StaffGroupKeySchema>

Expand All @@ -21,6 +21,7 @@ export const staffGroupKeyByName = {
財務組: 'finance',
場務組: 'service',
製播組: 'production',
UCA: 'UCA',
} as const satisfies Record<StaffGroupName, StaffGroupKey>

export const StaffRowSchema = z.object({
Expand Down