Skip to content

Commit 5e1ed41

Browse files
Fix mapping issue with animalTag and MultiSelect
1 parent 70ada76 commit 5e1ed41

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backend/typescript/models/user.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export default class User extends Model {
2929
color_level!: number;
3030

3131
@Column({
32-
type: DataType.ENUM("Bird", "Bunny", "Cat", "Dog", "Small Animal"),
32+
type: DataType.ARRAY(DataType.ENUM("Bird", "Bunny", "Cat", "Dog", "Small Animal")),
3333
allowNull: false,
3434
})
35-
animal_tags!: [AnimalTag];
35+
animal_tags!: AnimalTag[];
3636

3737
@Column({ type: DataType.BOOLEAN })
3838
can_see_all_logs?: boolean | null;

frontend/src/components/common/MultiSelect.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ReactComponent as ExpandIcon } from "../../assets/icons/expand.svg";
1515
interface MultiSelectProps<T> {
1616
values: T[];
1717
onSelect: (values: T[]) => void;
18-
selected: T[];
18+
selected?: T[];
1919
placeholder?: string;
2020
label?: string;
2121
error?: boolean;
@@ -27,7 +27,7 @@ interface MultiSelectProps<T> {
2727
const MultiSelect = <T extends string | number>({
2828
values,
2929
onSelect,
30-
selected,
30+
selected = [],
3131
placeholder = "Click for options",
3232
label,
3333
error = false,

0 commit comments

Comments
 (0)