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
|
* @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
|
* @returns ActivityStream location representation
|
||||||
*/
|
*/
|
||||||
Place.prototype.toAP = function () {
|
Place.prototype.toAP = function () {
|
||||||
|
@ -28,8 +28,7 @@ module.exports = (sequelize, DataTypes) => {
|
||||||
type: 'Place',
|
type: 'Place',
|
||||||
name: this.name,
|
name: this.name,
|
||||||
address: this.address,
|
address: this.address,
|
||||||
latitude: this.latitude,
|
...( this.latitude && this.longitude && ({ latitude: this.latitude, longitude: this.longitude}))
|
||||||
longitude: this.longitude
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,7 @@ const Helpers = {
|
||||||
async parsePlace (APEvent) {
|
async parsePlace (APEvent) {
|
||||||
const eventController = require('../api/controller/event')
|
const eventController = require('../api/controller/event')
|
||||||
let place
|
let place
|
||||||
|
|
||||||
if (APEvent?.location) {
|
if (APEvent?.location) {
|
||||||
place = {
|
place = {
|
||||||
place_name: APEvent.location?.name,
|
place_name: APEvent.location?.name,
|
||||||
|
@ -233,7 +234,7 @@ const Helpers = {
|
||||||
|
|
||||||
const APEvent = message.object
|
const APEvent = message.object
|
||||||
|
|
||||||
// validate coming events
|
// validate incoming events
|
||||||
const required_fields = ['name', 'startTime', 'id']
|
const required_fields = ['name', 'startTime', 'id']
|
||||||
let missing_field = required_fields.find(required_field => !APEvent[required_field])
|
let missing_field = required_fields.find(required_field => !APEvent[required_field])
|
||||||
if (missing_field) {
|
if (missing_field) {
|
||||||
|
|
Loading…
Reference in a new issue