Skip to content

Commit

Permalink
Merge pull request #3237 from numbersprotocol/feature-action-sort-field
Browse files Browse the repository at this point in the history
feat(ActionService): add query param sort_field=index to sort network actions
  • Loading branch information
shc261392 authored Mar 13, 2024
2 parents f5028f3 + 55f28f7 commit 7f9f8f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/shared/actions/service/actions.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { defer, forkJoin, of } from 'rxjs';
import { map } from 'rxjs/operators';
Expand All @@ -12,9 +12,13 @@ export class ActionsService {
constructor(private readonly httpClient: HttpClient) {}

getActions$() {
const params = new HttpParams({ fromObject: { sort_field: 'index' } });
return defer(() =>
this.httpClient
.get<GetActionsResponse<Action>>(`${BUBBLE_DB_URL}/api/1.1/obj/action`)
.get<GetActionsResponse<Action>>(
`${BUBBLE_DB_URL}/api/1.1/obj/action`,
{ params }
)
.pipe(map(response => response.response.results))
);
}
Expand Down

0 comments on commit 7f9f8f0

Please sign in to comment.