improve installation/documentation
This commit is contained in:
@@ -59,13 +59,13 @@ ${event.description.length > 200 ? event.description.substr(0, 200) + '...' : ev
|
||||
const type = msg.event
|
||||
|
||||
if (type === 'delete') {
|
||||
const activitypub_id = msg.data
|
||||
const activitypub_id = String(msg.data)
|
||||
const event = await Comment.findOne({ where: { activitypub_id } })
|
||||
if (event) await event.destroy()
|
||||
return
|
||||
}
|
||||
|
||||
const activitypub_id = msg.data.in_reply_to_id
|
||||
const activitypub_id = String(msg.data.in_reply_to_id)
|
||||
if (!activitypub_id) return
|
||||
let event = await Event.findOne({ where: { activitypub_id } })
|
||||
if (!event) {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
'use strict'
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
const comment = sequelize.define('comment', {
|
||||
activitypub_id: DataTypes.STRING(18),
|
||||
activitypub_id: {
|
||||
type: DataTypes.STRING(18),
|
||||
index: true,
|
||||
unique: true,
|
||||
},
|
||||
data: DataTypes.JSON
|
||||
}, {})
|
||||
comment.associate = function (models) {
|
||||
|
||||
@@ -6,7 +6,11 @@ const sharp = require('sharp')
|
||||
const consola = require('consola')
|
||||
const config = require('config')
|
||||
|
||||
mkdirp.sync(config.upload_path + '/thumb')
|
||||
try {
|
||||
mkdirp.sync(config.upload_path + '/thumb')
|
||||
} catch (e) {
|
||||
consola.error(e)
|
||||
}
|
||||
|
||||
const DiskStorage = {
|
||||
_handleFile(req, file, cb) {
|
||||
|
||||
Reference in New Issue
Block a user