diff --git a/pages/tag/_tag.vue b/pages/tag/_tag.vue index 2ada2331..8ff261c6 100644 --- a/pages/tag/_tag.vue +++ b/pages/tag/_tag.vue @@ -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!' }) diff --git a/server/api/models/filter.js b/server/api/models/filter.js index cf3b0851..1a6cbe8a 100644 --- a/server/api/models/filter.js +++ b/server/api/models/filter.js @@ -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