fix schema and add nullable
This commit is contained in:
@@ -3,6 +3,7 @@ import { z } from "zod";
|
|||||||
import type { TidalService } from "../tidal/service.js";
|
import type { TidalService } from "../tidal/service.js";
|
||||||
import { HomeAssistantService } from "../homeassistant/service.js";
|
import { HomeAssistantService } from "../homeassistant/service.js";
|
||||||
import { HomepageService } from "./service.js";
|
import { HomepageService } from "./service.js";
|
||||||
|
import { API_HA_DeskPosition, TidalGetCurrent } from "@dpu/shared";
|
||||||
|
|
||||||
export async function homepageRoutes(
|
export async function homepageRoutes(
|
||||||
fastify: FastifyInstance,
|
fastify: FastifyInstance,
|
||||||
@@ -25,12 +26,9 @@ export async function homepageRoutes(
|
|||||||
tags: ["homepage"],
|
tags: ["homepage"],
|
||||||
response: {
|
response: {
|
||||||
200: z.object({
|
200: z.object({
|
||||||
title: z.string(),
|
ha_desk_position: z.custom<API_HA_DeskPosition>().nullable(),
|
||||||
artists: z.string(),
|
ha_temp: z.string().nullable(),
|
||||||
status: z.string(),
|
tidal_current: z.custom<TidalGetCurrent>().nullable(),
|
||||||
current: z.string(),
|
|
||||||
duration: z.string(),
|
|
||||||
url: z.string(),
|
|
||||||
}),
|
}),
|
||||||
418: z.object({
|
418: z.object({
|
||||||
error: z.string(),
|
error: z.string(),
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {
|
import {
|
||||||
BaseClient,
|
|
||||||
BaseService,
|
BaseService,
|
||||||
FullInformation,
|
FullInformation,
|
||||||
HomeAssistantDeskPositionResult,
|
HomeAssistantDeskPositionResult,
|
||||||
|
|||||||
Reference in New Issue
Block a user