first commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import type { AiImportResponse, AiExtractedCategory } from "@menulio/shared";
|
||||
|
||||
let currentImportData: AiImportResponse | null = null;
|
||||
|
||||
export const aiStore = {
|
||||
setImportData: (data: AiImportResponse) => {
|
||||
currentImportData = data;
|
||||
},
|
||||
getImportData: (): AiImportResponse | null => {
|
||||
return currentImportData;
|
||||
},
|
||||
updateCategories: (categories: AiExtractedCategory[]) => {
|
||||
if (currentImportData) {
|
||||
currentImportData = {
|
||||
...currentImportData,
|
||||
categories,
|
||||
};
|
||||
}
|
||||
},
|
||||
clear: () => {
|
||||
currentImportData = null;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user