Skip to content

Commit

Permalink
fix: use inline type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-Chew committed Sep 28, 2023
1 parent 75084de commit 63a780f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/admin/event/upload-attendees.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { ParseResult } from 'papaparse'
import { parse } from 'papaparse'
import { ref } from 'vue'
import { createId } from '@paralleldrive/cuid2'
import type { EventWithAttendees, ImportedUser } from '~/shared/types'
import type { EventWithAttendees, User } from '~/shared/types'
const props = defineProps<{
event: EventWithAttendees
}>()
let uploadedAttendees: ImportedUser[]
let uploadedAttendees: Omit<User, 'firebaseId' | 'id'>[]
const pending = ref(false)
const isUploaded = ref(false)
const error = ref({
Expand All @@ -33,7 +33,7 @@ function handleFileUpload(e: Event) {
parse(file.value, {
skipEmptyLines: true,
header: true,
complete(results: ParseResult<ImportedUser>) {
complete(results: ParseResult<Omit<User, 'firebaseId' | 'id'>>) {
uploadedAttendees = results.data
if (JSON.stringify(results.meta.fields?.sort()) !== JSON.stringify(['name', 'memberId', 'email', 'graduationYear', 'memberType'].sort())) {
Expand Down
1 change: 0 additions & 1 deletion shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { InferSelectModel } from 'drizzle-orm'
import type { events, news, users } from '~/server/db/schema'

export type User = InferSelectModel<typeof users>
export type ImportedUser = Omit<User, 'firebaseId' | 'id'>
export type UserRestricted = Pick<User, 'id' | 'name'>
export type UserRestrictedWithAdmissionKey = UserRestricted & { admissionKey: string }

Expand Down

0 comments on commit 63a780f

Please sign in to comment.