Browse Source

sorting asc by name

pull/2/head
wahyuun 1 year ago
parent
commit
b419d03340
  1. 6
      src/views/SimproV2/CreatedProyek/DialogHierarchy.js

6
src/views/SimproV2/CreatedProyek/DialogHierarchy.js

@ -16,6 +16,7 @@ import { useTranslation } from 'react-i18next';
import { async } from '@dabeng/react-orgchart';
import { Link } from 'react-router-dom';
import { use } from 'i18next';
import _ from 'lodash';
const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName }) => {
const token = localStorage.getItem("token")
const HEADER = {
@ -154,7 +155,8 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek
.catch((error) => error.response);
if (result && result.status == 200) {
setDataHierarchy(result.data.data);
const sortedData = _.orderBy(result.data.data, ['name'], ['asc']);
setDataHierarchy(sortedData);
} else {
NotificationManager.error(`Data gantt project gagal terload silahkan coba lagi!`, 'Failed!!');
}
@ -340,4 +342,4 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek
}
export default DialogHierarchy;
export default DialogHierarchy;

Loading…
Cancel
Save