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