Skip to content

Commit

Permalink
string template
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewjeska committed Aug 10, 2023
1 parent dcfe056 commit 897ac5c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { withRouteSpec } from "lib/middleware/with-route-spec.ts"
import { climate_setting } from "lib/zod/climate_setting.ts"
import { climate_setting_schedule } from "lib/zod/climate_setting_schedule.ts"
import { timestamp } from "lib/zod/common.ts"
import { randomUUID } from "crypto"

const jsonBody = z
.object({
Expand Down Expand Up @@ -49,7 +50,7 @@ export default withRouteSpec({
workspace_id: req.auth.workspace_id,
schedule_type,
device_id,
name: name ?? "Schedule ${randomUUID().slice(5)}",
name: name ?? `Schedule ${randomUUID().slice(5)}`,
schedule_starts_at: new Date(schedule_starts_at).toISOString(),
schedule_ends_at: new Date(schedule_ends_at).toISOString(),
...climate_setting_for_schedule,
Expand Down

0 comments on commit 897ac5c

Please sign in to comment.