Skip to content

Commit

Permalink
Fix wrong assosiation at tracks.
Browse files Browse the repository at this point in the history
  • Loading branch information
feserr committed Oct 24, 2023
1 parent 7119485 commit 3721d6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/db/models/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { Model } = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class Track extends Model {
static associate(models) {
Track.hasOne(models.User, { foreignKey: 'userId', as: 'User' });
Track.belongsTo(models.User, { foreignKey: 'userId', as: 'User' });
Track.hasMany(models.Like, { foreignKey: 'trackId', as: 'Like' });
}
}
Expand Down

0 comments on commit 3721d6d

Please sign in to comment.