From b5b87fe587d42170cec6e47b7cd91fb69dd64c5d Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Sun, 27 Sep 2020 17:00:00 -0600 Subject: [PATCH] Fix json naming of ProgramItem section_id to use camelCase --- src/database/migrations/0006-fix_view_program_seq-up.sql | 2 +- src/model/program.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/database/migrations/0006-fix_view_program_seq-up.sql b/src/database/migrations/0006-fix_view_program_seq-up.sql index 7873c54..3fd673c 100644 --- a/src/database/migrations/0006-fix_view_program_seq-up.sql +++ b/src/database/migrations/0006-fix_view_program_seq-up.sql @@ -4,7 +4,7 @@ CREATE VIEW program_sequences AS WITH psi_sorted AS ( SELECT psi.program_id program_id, json_object( - 'section_id', psi.section_id, + 'sectionId', psi.section_id, 'duration', psi.duration) obj FROM program_sequence_items AS psi diff --git a/src/model/program.rs b/src/model/program.rs index 5b45cee..112da50 100644 --- a/src/model/program.rs +++ b/src/model/program.rs @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize}; use std::{sync::Arc, time::Duration}; #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct ProgramItem { pub section_id: SectionId, #[serde(