Skip to content

Node.js based forum software built for the modern web

fix: missing file added

Julian Lamef10b6b70d1c
diff --git a/public/src/modules/topicThumbs.js b/public/src/modules/topicThumbs.js
new file mode 100644
index 0000000000..e2fdb12507
--- /dev/null
+++ b/public/src/modules/topicThumbs.js
@@ -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;
+});