Skip to content

Commit 486c2f2

Browse files
chore: rename /get-update-reference-data endpoint
1 parent ba56a47 commit 486c2f2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/gui/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ exports.start = async ({paths, hermione, guiApi, configs}) => {
7474
}
7575
});
7676

77-
server.post('/get-update-reference-data', (req, res) => {
77+
server.post('/reference-data-to-update', (req, res) => {
7878
try {
7979
const data = app.getTestsDataToUpdateRefs(req.body);
8080
res.json(data);

lib/static/modules/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const acceptOpened = (imageIds, type = actionNames.ACCEPT_OPENED_SCREENSH
135135
dispatch({type: actionNames.PROCESS_BEGIN});
136136

137137
try {
138-
const {data} = await axios.post('/get-update-reference-data', imageIds);
138+
const {data} = await axios.post('/reference-data-to-update', imageIds);
139139
const {data: updatedData} = await axios.post('/update-reference', data);
140140
dispatch({type, payload: updatedData});
141141

@@ -168,7 +168,7 @@ export const undoAcceptImages = (imageIds, {skipTreeUpdate = false} = {}) => {
168168
dispatch({type: actionNames.PROCESS_BEGIN});
169169

170170
try {
171-
const {data} = await axios.post('/get-update-reference-data', imageIds);
171+
const {data} = await axios.post('/reference-data-to-update', imageIds);
172172
const {data: updatedData} = await axios.post('/undo-accept-images', data);
173173
const payload = {...updatedData, skipTreeUpdate};
174174

test/unit/lib/static/modules/actions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ describe('lib/static/modules/actions', () => {
100100
it('should update opened images', async () => {
101101
const imageIds = ['img-id-1', 'img-id-2'];
102102
const images = [{id: 'img-id-1'}, {id: 'img-id-2'}];
103-
axios.post.withArgs('/get-update-reference-data', imageIds).returns({data: images});
103+
axios.post.withArgs('/reference-data-to-update', imageIds).returns({data: images});
104104

105105
await acceptOpened(imageIds)(dispatch);
106106

107-
assert.calledWith(axios.post.firstCall, '/get-update-reference-data', imageIds);
107+
assert.calledWith(axios.post.firstCall, '/reference-data-to-update', imageIds);
108108
assert.calledWith(axios.post.secondCall, '/update-reference', images);
109109
});
110110
});
@@ -113,11 +113,11 @@ describe('lib/static/modules/actions', () => {
113113
it('should cancel update of accepted image', async () => {
114114
const imageIds = ['img-id-1', 'img-id-2'];
115115
const images = [{id: 'img-id-1'}, {id: 'img-id-2'}];
116-
axios.post.withArgs('/get-update-reference-data', imageIds).returns({data: images});
116+
axios.post.withArgs('/reference-data-to-update', imageIds).returns({data: images});
117117

118118
await undoAcceptImages(imageIds)(dispatch);
119119

120-
assert.calledWith(axios.post.firstCall, '/get-update-reference-data', imageIds);
120+
assert.calledWith(axios.post.firstCall, '/reference-data-to-update', imageIds);
121121
assert.calledWith(axios.post.secondCall, '/undo-accept-images', images);
122122
assert.calledWith(dispatch, {
123123
type: actionNames.UNDO_ACCEPT_IMAGES,

0 commit comments

Comments
 (0)