u
This commit is contained in:
@@ -63,6 +63,22 @@ const actions = {
|
||||
return terminal;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update a posterminal.
|
||||
* @param {number} terminalId
|
||||
* @param {object} patch
|
||||
*/
|
||||
async update(terminalId, patch) {
|
||||
const res = await posterminalApi.update(terminalId, patch);
|
||||
const updated = res.posterminal;
|
||||
posterminalAutomat.setState({
|
||||
terminals: posterminalAutomat.state.terminals.map((t) =>
|
||||
t.id === terminalId ? { ...t, ...updated } : t
|
||||
),
|
||||
});
|
||||
return updated;
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete a posterminal.
|
||||
* @param {number} terminalId
|
||||
|
||||
Reference in New Issue
Block a user