diff --git a/index.js b/index.js
index 0f09ab4..677457e 100644
--- a/index.js
+++ b/index.js
@@ -262,6 +262,25 @@ app.get('/stats', async (req, res, next) => {
}
})
+app.get('/moddata', async (req, res, next) => {
+ try {
+ console.log(req.query)
+ console.log(req.query.name)
+ console.log(apex.utils.usernameToIRI('test'))
+ console.log(await apex.utils.usernameToIRI('test'))
+ var object = await apex.store.getObject(apex.utils.usernameToIRI(req.query.name))
+ console.log(object)
+ console.log(object.id)
+ console.log("test")
+ const queueSize = await apex.store.db.collection(`${object.id}-queue`).find().toArray()
+ // console.log(res.json({queueSize}))
+ console.log(queueSize)
+ res.json(queueSize)
+ } catch (err) {
+ next(err)
+ }
+})
+
app.use(function (err, req, res, next) {
console.error(err.message, req.body, err.stack)
if (!res.headersSent) {
@@ -286,11 +305,10 @@ client.connect()
await apex.store.saveObject(systemUser)
apex.systemUser = systemUser
}
- apex.systemUser = await apex.store.getObject(apex.utils.usernameToIRI('testing'), true)
- if (!apex.systemUser) {
- const systemUser = await createGuppeActor('test', 'test', 'A project built on guppe groups\, it features a moderation ui', icon, 'Group')
- await apex.store.saveObject(systemUser)
- apex.systemUser = systemUser
+ apex.group = await apex.store.getObject(apex.utils.usernameToIRI('testing'), true)
+ if (!apex.group) {
+ const group = await createGuppeActor('test', 'test', 'A project built on guppe groups\, it features a moderation ui', icon, 'Group')
+ await apex.store.saveObject(group)
}
let server
if (process.env.NODE_ENV === 'production') {
diff --git a/web/src/router.js b/web/src/router.js
index 4e519c4..08bd77e 100644
--- a/web/src/router.js
+++ b/web/src/router.js
@@ -2,6 +2,7 @@ import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Profile from './views/Profile.vue'
+import Moderation from './views/Moderation.vue'
Vue.use(Router)
@@ -18,6 +19,12 @@ export default new Router({
name: 'profile',
component: Profile,
props: true
+ },
+ {
+ path: '/mod/:name',
+ name: 'moderation',
+ component: Moderation,
+ props: true
}
],
scrollBehavior (to, from, savedPosition) {
diff --git a/web/src/views/Moderation.vue b/web/src/views/Moderation.vue
new file mode 100644
index 0000000..97ba8df
--- /dev/null
+++ b/web/src/views/Moderation.vue
@@ -0,0 +1,54 @@
+
+
+
Moderation for {{name}}
+
+
+
+
+
+
+
\ No newline at end of file