update api configuration for panel iot and adjust ai insight
This commit is contained in:
1 parent
a2b5b10977
commit
20d04acb3e
20 files changed
+814
-177
No files matched your search
@@ -252,6 +252,8 @@ export const api = {
|
||||
list: async (query?: CycleFilter) =>
|
||||
unwrapList(await get<Paginated<PanelIoT> | PanelIoT[]>('/panel-iot/', query)),
|
||||
dates: async (query?: CycleFilter) => get<string[]>('/panel-iot/dates/', query),
|
||||
sync: (body: { flock_id: number }) =>
|
||||
post<{ upserted: number; skipped: number; pages: number }>('/panel-iot/sync/', body),
|
||||
},
|
||||
insights: {
|
||||
list: async (query?: CycleFilter) =>
|
||||
@@ -267,7 +269,7 @@ export const api = {
|
||||
}
|
||||
return post<InsightApiResponse>('/ai-insights/generate/', body);
|
||||
},
|
||||
/** Fetch cached insight for the same scope key (no LLM call). */
|
||||
/** Load insight from DB for the same scope key (no LLM call). */
|
||||
cached: (params: InsightCachedParams) => {
|
||||
if (params.kandang_id == null) {
|
||||
return Promise.reject(new Error('kandang_id wajib — insight tidak boleh untuk semua kandang'));
|
||||
|
||||
Reference in new issue
Block a user