u
This commit is contained in:
@@ -64,6 +64,27 @@ const actions = {
|
||||
brandAutomat.setState({ brands });
|
||||
},
|
||||
|
||||
/**
|
||||
* Add / update brand image.
|
||||
* @param {number} id
|
||||
* @param {Blob|File} file
|
||||
*/
|
||||
async addImage(id, file) {
|
||||
const res = await brandApi.addImage(id, file);
|
||||
await brandAutomat.actions.load();
|
||||
return res.brand;
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete brand image.
|
||||
* @param {number} id
|
||||
*/
|
||||
async deleteImage(id) {
|
||||
const res = await brandApi.deleteImage(id);
|
||||
await brandAutomat.actions.load();
|
||||
return res.brand;
|
||||
},
|
||||
|
||||
/** Reset to idle state (called on logout / company switch). */
|
||||
reset() {
|
||||
brandAutomat.setState(initialState);
|
||||
|
||||
Reference in New Issue
Block a user