Skip to content

Commit

Permalink
fix: use model ids in place of names and rename patch function
Browse files Browse the repository at this point in the history
  • Loading branch information
romeonicholas committed Dec 6, 2023
1 parent 453f954 commit 354e249
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions frontend/src/app/projects/models/service/model.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class ModelService {
);
}

private patchModel(
private applyModelPatch(
projectSlug: string,
modelSlug: string,
patchData: PatchModel,
Expand All @@ -108,7 +108,7 @@ export class ModelService {
modelSlug: string,
patchModel: PatchModel,
): Observable<Model> {
return this.patchModel(projectSlug, modelSlug, patchModel).pipe(
return this.applyModelPatch(projectSlug, modelSlug, patchModel).pipe(
tap({
next: (model) => {
this.loadModels(projectSlug);
Expand All @@ -123,7 +123,7 @@ export class ModelService {
modelUpdates: { modelSlug: string; patchModel: PatchModel }[],
): Observable<Model[]> {
const updateObservables = modelUpdates.map(({ modelSlug, patchModel }) =>
this.patchModel(projectSlug, modelSlug, patchModel),
this.applyModelPatch(projectSlug, modelSlug, patchModel),
);

return forkJoin(updateObservables).pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2>Reorder models</h2>
(cdkDropListDropped)="drop($event)"
class="my-[15px] rounded border border-solid"
>
@for (model of data.models; track model.name) {
@for (model of data.models; track model.id) {
<div cdkDrag class="flex items-center border-b border-solid">
<span class="ml-[10px]">
<mat-icon class="mt-[10px] text-sm">reorder</mat-icon>
Expand Down

0 comments on commit 354e249

Please sign in to comment.