We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use .$add or $set with a Model in second parameter, I have as return: Invalid value {}
Tell me if my code is the problem or not but I can't find anyone in the same case as me on StackOverflow...
Thanks in advance
Service
const team: Teams = await this.teamModel.findByPk(id); const member: User = await this.userService.findOneById(users[0]); await team.$set('users', member); // return Invalid value {}
team.entity.ts
import { v4 as uuidv4 } from 'uuid' import { Table, Column, Model, BelongsToMany, BelongsTo, DataType } from 'sequelize-typescript'; import User from 'src/user/entities/user.entity'; import UserTeams from './teamUsers.entity'; @Table({ timestamps: true }) export default class Teams extends Model { @Column({ type: DataType.UUID, defaultValue: () => uuidv4(), primaryKey: true, unique: true, allowNull: false }) id: string; @Column({ type: DataType.STRING, allowNull: false }) name: string; //@BelongsTo(() => Projects, { foreignKey: 'id', as: 'project' }) @Column({ type: DataType.STRING, allowNull: false }) projectID: string; @BelongsToMany(() => User, () => UserTeams) users!: User[] }
The text was updated successfully, but these errors were encountered:
Go to TypeORM
Sorry, something went wrong.
No branches or pull requests
Issue
When I use .$add or $set with a Model in second parameter, I have as return: Invalid value {}
Tell me if my code is the problem or not but I can't find anyone in the same case as me on StackOverflow...
Thanks in advance
Versions
Issue type
Actual behavior
Expected behavior
Steps to reproduce
Related code
Service
team.entity.ts
The text was updated successfully, but these errors were encountered: