@rmdes/indiekit-endpoint-activitypub 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -149,11 +149,11 @@ export default class ActivityPubEndpoint {
149
149
  router.get("/admin/following", followingController(mp));
150
150
  router.get("/admin/activities", activitiesController(mp));
151
151
  router.get("/admin/featured", featuredGetController(mp));
152
- router.post("/admin/featured/pin", featuredPinController());
153
- router.post("/admin/featured/unpin", featuredUnpinController());
152
+ router.post("/admin/featured/pin", featuredPinController(mp));
153
+ router.post("/admin/featured/unpin", featuredUnpinController(mp));
154
154
  router.get("/admin/tags", featuredTagsGetController(mp));
155
- router.post("/admin/tags/add", featuredTagsAddController());
156
- router.post("/admin/tags/remove", featuredTagsRemoveController());
155
+ router.post("/admin/tags/add", featuredTagsAddController(mp));
156
+ router.post("/admin/tags/remove", featuredTagsRemoveController(mp));
157
157
  router.get("/admin/profile", profileGetController(mp));
158
158
  router.post("/admin/profile", profilePostController(mp));
159
159
  router.get("/admin/migrate", migrateGetController(mp, this.options));
@@ -24,7 +24,7 @@ export function featuredTagsGetController(mountPath) {
24
24
  };
25
25
  }
26
26
 
27
- export function featuredTagsAddController() {
27
+ export function featuredTagsAddController(mountPath) {
28
28
  return async (request, response, next) => {
29
29
  try {
30
30
  const { application } = request.app.locals;
@@ -44,14 +44,14 @@ export function featuredTagsAddController() {
44
44
  { upsert: true },
45
45
  );
46
46
 
47
- response.redirect("back");
47
+ response.redirect(`${mountPath}/admin/tags`);
48
48
  } catch (error) {
49
49
  next(error);
50
50
  }
51
51
  };
52
52
  }
53
53
 
54
- export function featuredTagsRemoveController() {
54
+ export function featuredTagsRemoveController(mountPath) {
55
55
  return async (request, response, next) => {
56
56
  try {
57
57
  const { application } = request.app.locals;
@@ -63,7 +63,7 @@ export function featuredTagsRemoveController() {
63
63
 
64
64
  await collection.deleteOne({ tag });
65
65
 
66
- response.redirect("back");
66
+ response.redirect(`${mountPath}/admin/tags`);
67
67
  } catch (error) {
68
68
  next(error);
69
69
  }
@@ -69,7 +69,7 @@ export function featuredGetController(mountPath) {
69
69
  };
70
70
  }
71
71
 
72
- export function featuredPinController() {
72
+ export function featuredPinController(mountPath) {
73
73
  return async (request, response, next) => {
74
74
  try {
75
75
  const { application } = request.app.locals;
@@ -90,14 +90,14 @@ export function featuredPinController() {
90
90
  { upsert: true },
91
91
  );
92
92
 
93
- response.redirect("back");
93
+ response.redirect(`${mountPath}/admin/featured`);
94
94
  } catch (error) {
95
95
  next(error);
96
96
  }
97
97
  };
98
98
  }
99
99
 
100
- export function featuredUnpinController() {
100
+ export function featuredUnpinController(mountPath) {
101
101
  return async (request, response, next) => {
102
102
  try {
103
103
  const { application } = request.app.locals;
@@ -109,7 +109,7 @@ export function featuredUnpinController() {
109
109
 
110
110
  await collection.deleteOne({ postUrl });
111
111
 
112
- response.redirect("back");
112
+ response.redirect(`${mountPath}/admin/featured`);
113
113
  } catch (error) {
114
114
  next(error);
115
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-activitypub",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
5
5
  "keywords": [
6
6
  "indiekit",