Skip to content

Commit 82015dd

Browse files
author
doripjonov
committed
code optimized
1 parent d1d6a53 commit 82015dd

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

endpoints/recognition_endpoints.js

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const recognition_endpoints = {
129129
},
130130

131131
/**
132-
* Delete image according to their id number
132+
* Delete image(s)
133133
* @param {String} url
134134
* @param {String} api_key
135135
* @returns {Promise}
@@ -140,36 +140,6 @@ const recognition_endpoints = {
140140
"x-api-key": api_key
141141
}})
142142

143-
return response;
144-
},
145-
146-
/**
147-
* Delete image according to their subject name
148-
* @param {String} url
149-
* @param {String} api_key
150-
* @returns {Promise}
151-
*/
152-
async delete_all_subject_request(url, api_key){
153-
const response = await axios.delete(url, {
154-
headers: {
155-
"x-api-key": api_key
156-
}})
157-
158-
return response;
159-
},
160-
161-
/**
162-
* Delete all images
163-
* @param {String} url
164-
* @param {String} api_key
165-
* @returns {Promise}
166-
*/
167-
async delete_all_request(url, api_key){
168-
const response = await axios.delete(url, {
169-
headers: {
170-
"x-api-key": api_key
171-
}})
172-
173143
return response;
174144
}
175145
}

services/recognition_service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class RecognitionService {
195195
url = `${url}?subject=${subject}`;
196196

197197
return new Promise((resolve, reject) => {
198-
recognition_endpoints.delete_all_subject_request(url, key)
198+
recognition_endpoints.delete_request(url, key)
199199
.then(response => {
200200
return resolve(response.data);
201201
})
@@ -211,7 +211,7 @@ class RecognitionService {
211211
*/
212212
delete_all(){
213213
return new Promise((resolve, reject) => {
214-
recognition_endpoints.delete_all_request(url, key)
214+
recognition_endpoints.delete_request(url, key)
215215
.then(response => {
216216
return resolve(response.data);
217217
})

0 commit comments

Comments
 (0)