Skip to content

Commit

Permalink
fix: provide more accurate query param types
Browse files Browse the repository at this point in the history
  • Loading branch information
BenShelton committed Mar 30, 2021
1 parent b103710 commit e87d56f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/router/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Media } from 'types/api'
const router = Router()

router.get('/watchtower', async (req, res) => {
const { date } = req.query as Media.Watchtower.QueryParams
const { date } = req.query as Partial<Media.Watchtower.QueryParams>
if (!isValidDate(date)) return res.status(401).json({ message: 'Invalid Date' })

const pubQuery = `
Expand Down
2 changes: 1 addition & 1 deletion types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export namespace Catalog {
export namespace Media {
export namespace Watchtower {
export interface QueryParams {
date?: string
date: string
}
export interface Response {
message: {
Expand Down

0 comments on commit e87d56f

Please # to comment.