This commit is contained in:
lesion 2022-06-18 01:12:40 +02:00
parent a2ffcfe8f1
commit 4d39fc41c5
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 4 additions and 4 deletions

View file

@ -32,7 +32,7 @@ export default {
async asyncData ({ $axios, params, error }) {
try {
const tag = params.tag
const events = await $axios.$get(`/events?tags=${tag}`)
const events = await $axios.$get(`/tag/${tag}`)
return { events, tag }
} catch (e) {
error({ statusCode: 400, message: 'Error!' })

View file

@ -1,5 +1,5 @@
const { Model, DataTypes } = require('sequelize')
const Cohort = require('./cohort')
const Collection = require('./collection')
const sequelize = require('./index').sequelize
class Filter extends Model {}
@ -18,7 +18,7 @@ Filter.init({
}
}, { sequelize, modelName: 'filter', timestamps: false })
Filter.belongsTo(Cohort)
Cohort.hasMany(Filter)
Filter.belongsTo(Collection)
Collection.hasMany(Filter)
module.exports = Filter