fix: missing file added
parent
4152aa552e
commit
ef10b6b70d
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
define('topicThumbs', ['api'], function (api) {
|
||||
const Thumbs = {};
|
||||
|
||||
Thumbs.get = id => api.get(`/topics/${id}/thumbs`, {});
|
||||
|
||||
Thumbs.delete = (id, path) => api.del(`/topics/${id}/thumbs`, {
|
||||
path: path,
|
||||
});
|
||||
|
||||
Thumbs.deleteAll = (id) => {
|
||||
Thumbs.get(id).then((thumbs) => {
|
||||
Promise.all(thumbs.map(thumb => Thumbs.delete(id, thumb.url)));
|
||||
});
|
||||
};
|
||||
|
||||
return Thumbs;
|
||||
});
|
Loading…
Reference in New Issue