mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 18:33:01 +00:00
data sorting
This commit is contained in:
@@ -29,6 +29,7 @@ function Index() {
|
|||||||
userId: user.id,
|
userId: user.id,
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
const organisations = data as OrganisationResponse[];
|
const organisations = data as OrganisationResponse[];
|
||||||
|
organisations.sort((a, b) => a.Organisation.name.localeCompare(b.Organisation.name));
|
||||||
setOrganisations(organisations);
|
setOrganisations(organisations);
|
||||||
|
|
||||||
let selected: OrganisationResponse | null = null;
|
let selected: OrganisationResponse | null = null;
|
||||||
@@ -77,6 +78,7 @@ function Index() {
|
|||||||
organisationId,
|
organisationId,
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
const projects = data as ProjectResponse[];
|
const projects = data as ProjectResponse[];
|
||||||
|
projects.sort((a, b) => a.Project.name.localeCompare(b.Project.name));
|
||||||
setProjects(projects);
|
setProjects(projects);
|
||||||
|
|
||||||
let selected: ProjectResponse | null = null;
|
let selected: ProjectResponse | null = null;
|
||||||
@@ -131,6 +133,7 @@ function Index() {
|
|||||||
projectId: selectedProject?.Project.id || 0,
|
projectId: selectedProject?.Project.id || 0,
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
const issues = data as IssueResponse[];
|
const issues = data as IssueResponse[];
|
||||||
|
issues.reverse(); // newest at the bottom, but if the order has been rearranged, respect that
|
||||||
setIssues(issues);
|
setIssues(issues);
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user