Skip to content

Commit

Permalink
Fix GladysAssistant#785 : Fix delete bug when deleting just created r…
Browse files Browse the repository at this point in the history
…tsp-camera (GladysAssistant#842)
  • Loading branch information
Pierre-Gilles authored and NickDub committed Aug 7, 2020
1 parent 0820d57 commit 57d39e9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion front/src/routes/integration/all/rtsp-camera/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,15 @@ function createActions(store) {
async saveCamera(state, index) {
const camera = state.rtspCameras[index];
camera.features[0].name = camera.name;
await state.httpClient.post(`/api/v1/device`, camera);
const newCamera = await state.httpClient.post(`/api/v1/device`, camera);
const rtspCameras = update(state.rtspCameras, {
[index]: {
$set: newCamera
}
});
store.setState({
rtspCameras
});
},
async deleteCamera(state, index) {
const camera = state.rtspCameras[index];
Expand Down

0 comments on commit 57d39e9

Please sign in to comment.