feat: implement keyword migration functionality and update related components
This commit is contained in:
@@ -157,6 +157,7 @@ interface SettingsState {
|
||||
// Keywords
|
||||
addKeyword: (keyword: KeywordDefinition) => void;
|
||||
updateKeyword: (id: string, updates: Partial<Omit<KeywordDefinition, 'id'>>) => void;
|
||||
renameKeyword: (oldId: string, newKeyword: KeywordDefinition) => void;
|
||||
removeKeyword: (id: string) => void;
|
||||
reorderKeywords: (keywords: KeywordDefinition[]) => void;
|
||||
getKeywordById: (id: string) => KeywordDefinition | undefined;
|
||||
@@ -389,6 +390,14 @@ export const useSettingsStore = create<SettingsState>()(
|
||||
});
|
||||
},
|
||||
|
||||
renameKeyword: (oldId: string, newKeyword: KeywordDefinition) => {
|
||||
set({
|
||||
emailKeywords: get().emailKeywords.map(k =>
|
||||
k.id === oldId ? newKeyword : k
|
||||
),
|
||||
});
|
||||
},
|
||||
|
||||
removeKeyword: (id: string) => {
|
||||
set({ emailKeywords: get().emailKeywords.filter(k => k.id !== id) });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user