mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 04:02:40 -05:00
addTagArray typing from global type
This commit is contained in:
parent
61ace7e9b2
commit
0ac3ad9c2b
2
TODO.md
2
TODO.md
|
|
@ -22,6 +22,6 @@ Calendar
|
|||
- [x] Type problem with Avatar
|
||||
- [x] Maybe classNames that do nothing on calendar event page?
|
||||
- [x] refactor global.css/common.css -> variables.css / utils.css / common.css
|
||||
- [ ] addTagArray get tags type from constant
|
||||
- [x] addTagArray get tags type from constant
|
||||
- [x] Rename model events -> calendarEvents
|
||||
- [x] On the event page should not say Day 1 if only one day
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import { dateToDatabaseTimestamp } from "~/utils/dates";
|
||||
import { sql } from "../sql";
|
||||
import type { CalendarEvent, CalendarEventDate, User, Badge } from "../types";
|
||||
import type {
|
||||
CalendarEvent,
|
||||
CalendarEventDate,
|
||||
User,
|
||||
Badge,
|
||||
CalendarEventTag,
|
||||
} from "../types";
|
||||
|
||||
const findAllBetweenTwoTimestampsStm = sql.prepare(`
|
||||
select
|
||||
|
|
@ -37,7 +43,7 @@ function addTagArray<
|
|||
T extends { hasBadge: number; tags?: CalendarEvent["tags"] }
|
||||
>(arg: T) {
|
||||
const { hasBadge, ...row } = arg;
|
||||
const tags = (row.tags ? row.tags.split(",") : []) as Array<"BADGE_PRIZE">;
|
||||
const tags = (row.tags ? row.tags.split(",") : []) as Array<CalendarEventTag>;
|
||||
|
||||
if (hasBadge) tags.push("BADGE_PRIZE");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user