added place.latitude and place.longitude, fix routes

This commit is contained in:
sedum
2022-09-19 05:13:57 +02:00
parent 838d1988ad
commit 0fb39b2c07
12 changed files with 168 additions and 118 deletions

View File

@@ -106,7 +106,8 @@ Event.prototype.toAP = function (username, locale, to = []) {
location: {
name: this.place.name,
address: this.place.address,
details: this.place.details
latitude: this.place.latitude,
longitude: this.place.longitude
},
attachment,
tag: tags && tags.map(tag => ({

View File

@@ -11,7 +11,8 @@ Place.init({
allowNull: false
},
address: DataTypes.STRING,
details: DataTypes.JSON
latitude: DataTypes.FLOAT,
longitude: DataTypes.FLOAT,
}, { sequelize, modelName: 'place' })
module.exports = Place