diff --git a/frontend/src/app/projects/project-detail/model-overview/reorder-models-dialog/reorder-models-dialog.component.html b/frontend/src/app/projects/project-detail/model-overview/reorder-models-dialog/reorder-models-dialog.component.html
index b4695605be..f0c59adb68 100644
--- a/frontend/src/app/projects/project-detail/model-overview/reorder-models-dialog/reorder-models-dialog.component.html
+++ b/frontend/src/app/projects/project-detail/model-overview/reorder-models-dialog/reorder-models-dialog.component.html
@@ -17,7 +17,7 @@
Reorder models
(cdkDropListDropped)="drop($event)"
class="my-[15px] rounded border border-solid"
>
- @for (model of data.models; track model.id) {
+ @for (model of models; track model.id) {
): void {
- moveItemInArray(this.data.models, event.previousIndex, event.currentIndex);
+ if (this.models === undefined) return;
+ moveItemInArray(this.models, event.previousIndex, event.currentIndex);
}
async reorderModels() {
- const modelsToPatch = this.data.models.map((model, index) => {
+ if (this.models === undefined) return;
+ const modelsToPatch = this.models.map((model, index) => {
return {
modelSlug: model.slug,
patchModel: { display_order: index + 1 },