Encountered an issue while attempting to POST an Object (User). The error message appeared when structuring it as follows:
Below is the model class used:
export class User {
userRoles: Set<UserRole>;
id: number;
}
In my TypeScript file, I included:
const newUser = new User();
var userRoleList = new Set<UserRole>();
var iterator = userRoleList .values();
newUser.userRoles= Array.from(iterator);
The following error occurred:
error TS2740: Type 'UserRole[]' is missing the following properties from type 'Set': add, clear, delete, has, and 2 more. newUser.userRoles= Array.from(iterator);
Any suggestions or solutions? Thank you.