diff options
author | Devlin Junker <devlin.junker@gmail.com> | 2022-12-03 16:39:00 -0800 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2022-12-06 14:57:20 +0100 |
commit | e61fb48d64fe11c42c84b0a46d859c08b10a3fb8 (patch) | |
tree | 6d1e4fa5c745750510f91e241f30a4b878d308f2 /src | |
parent | 2c32ea05f0a0f266e36075e702ee293d7834bf62 (diff) |
basic tests for store
Signed-off-by: Devlin Junker <devlin.junker@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/store/folder.ts | 5 | ||||
-rw-r--r-- | src/store/index.ts | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/store/folder.ts b/src/store/folder.ts index 70a05c4ed..77d8a3b15 100644 --- a/src/store/folder.ts +++ b/src/store/folder.ts @@ -39,14 +39,15 @@ export const actions = { const response = await axios.post(folderUrl, { folderName: folder.name }) commit(FOLDER_MUTATION_TYPES.SET_FOLDERS, response.data.folders) }, - [FOLDER_ACTION_TYPES.DELETE_FOLDER]({ commit }: ActionParams, { folder }: { folder: Folder}) { + async [FOLDER_ACTION_TYPES.DELETE_FOLDER]({ commit }: ActionParams, { folder }: { folder: Folder}) { /** this.getByFolderId(folderId).forEach(function (feed) { promises.push(self.reversiblyDelete(feed.id, false, true)); }); this.updateUnreadCache(); */ - axios.delete(folderUrl + '/' + folder.id).then(() => commit(FOLDER_MUTATION_TYPES.DELETE_FOLDER, folder)) + await axios.delete(folderUrl + '/' + folder.id) + commit(FOLDER_MUTATION_TYPES.DELETE_FOLDER, folder) }, // loadFolder({commit}) { // console.log('loading folders') diff --git a/src/store/index.ts b/src/store/index.ts index 277bbfc2a..1a6dfc1c9 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -13,12 +13,12 @@ export const ACTIONS = { ...FOLDER_ACTION_TYPES, } -export type ActionParams = { commit: any }; +type Func = (name: string, value: unknown) => void; +export type ActionParams = { commit: Func }; export type AppState = { feeds: Feed[]; folders: Folder[]; - items: any[]; } export default { |