mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
minor
This commit is contained in:
parent
8ef52db372
commit
19c50527f8
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||
|
||||
/**
|
||||
* @description WIP -> https://codeberg.org/fediverse/fep/src/commit/4a75a1bc50bc6d19fc1e6112f02c52621bc178fe/fep/8a8e/fep-8a8e.md#location
|
||||
* @todo support PlaceAddress type
|
||||
* @todo support PostalAddress type
|
||||
* @returns ActivityStream location representation
|
||||
*/
|
||||
Place.prototype.toAP = function () {
|
||||
|
@ -28,8 +28,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||
type: 'Place',
|
||||
name: this.name,
|
||||
address: this.address,
|
||||
latitude: this.latitude,
|
||||
longitude: this.longitude
|
||||
...( this.latitude && this.longitude && ({ latitude: this.latitude, longitude: this.longitude}))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -178,6 +178,7 @@ const Helpers = {
|
|||
async parsePlace (APEvent) {
|
||||
const eventController = require('../api/controller/event')
|
||||
let place
|
||||
|
||||
if (APEvent?.location) {
|
||||
place = {
|
||||
place_name: APEvent.location?.name,
|
||||
|
@ -233,7 +234,7 @@ const Helpers = {
|
|||
|
||||
const APEvent = message.object
|
||||
|
||||
// validate coming events
|
||||
// validate incoming events
|
||||
const required_fields = ['name', 'startTime', 'id']
|
||||
let missing_field = required_fields.find(required_field => !APEvent[required_field])
|
||||
if (missing_field) {
|
||||
|
|
Loading…
Reference in a new issue