fix: sync capture override response
This commit is contained in:
@@ -102,6 +102,18 @@ export async function handleSetCaptureOverride(input: {
|
||||
return { status: 500, body: { error: "insert_failed" } };
|
||||
}
|
||||
|
||||
const assetRows = await db<
|
||||
{
|
||||
capture_ts_utc: string | null;
|
||||
}[]
|
||||
>`
|
||||
select capture_ts_utc
|
||||
from assets
|
||||
where id = ${created.asset_id}
|
||||
limit 1
|
||||
`;
|
||||
const baseCaptureTs = assetRows[0]?.capture_ts_utc ?? null;
|
||||
|
||||
const payload = JSON.stringify({
|
||||
capture_ts_utc_override: created.capture_ts_utc_override,
|
||||
capture_offset_minutes_override: created.capture_offset_minutes_override,
|
||||
@@ -111,5 +123,11 @@ export async function handleSetCaptureOverride(input: {
|
||||
values ('admin', 'override_capture_ts', 'asset', ${created.asset_id}, ${payload}::jsonb)
|
||||
`;
|
||||
|
||||
return { status: 200, body: created };
|
||||
return {
|
||||
status: 200,
|
||||
body: {
|
||||
...created,
|
||||
base_capture_ts_utc: baseCaptureTs,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user