Skip to content

Commit

Permalink
refactor(projects): order
Browse files Browse the repository at this point in the history
  • Loading branch information
Penkie committed Feb 12, 2024
1 parent 0de5679 commit 956aee3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/common/models/project.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export interface Project {
description: string;
id: string;
link: string;
status: string;
status: Status;
order: number;
title: string;
updated: Date;
}
Expand Down
5 changes: 4 additions & 1 deletion src/app/pages/projects/projects.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Observable, map } from 'rxjs';
import { Project } from 'src/app/common/models/project.model';
import { ProjectsService } from 'src/app/common/services/projects.service';

Expand All @@ -18,6 +18,9 @@ export class ProjectsComponent implements OnInit {

public ngOnInit(): void {
this.projectsService.getProjects$()
.pipe(
map(projects => projects.sort((a, b) => a.order - b.order))
)
.subscribe(projects => {
this.projects = projects;
});
Expand Down

0 comments on commit 956aee3

Please sign in to comment.