Skip to content

Commit

Permalink
Merge pull request #134 from kbss-cvut/feature/128-optimize-loading-d…
Browse files Browse the repository at this point in the history
…ashboard-entities

Use optimized server API to fetch dashboard entity lists
  • Loading branch information
blcham authored Jan 4, 2024
2 parents 9d5107b + 0a55b98 commit 78932ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/services/failureModesTableService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {handleServerError} from "@services/utils/responseUtils";
export const findAll = async (): Promise<FailureModesTable[]> => {
try {
const response = await axiosClient.get<FailureModesTable[]>(
'/failureModesTable',
'/failureModesTable/summaries',
{
headers: authHeaders()
}
Expand Down Expand Up @@ -133,6 +133,7 @@ export const createAggregate = async (table: CreateFailureModesTable): Promise<F


export const eventPathsToRows = (eventPathsMap: Map<number, FaultEvent[]>, rpnsMap: Map<number, RiskPriorityNumber>): FailureModesRow[] => {
// this transformation does not follow the FMEA generation rules established in issues/46
return Array.from(eventPathsMap).map(([key, path]) => {
const rpn = rpnsMap.get(key)
return {
Expand Down
2 changes: 1 addition & 1 deletion src/services/faultTreeService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {handleServerError} from "@services/utils/responseUtils";
export const findAll = async (): Promise<FaultTree[]> => {
try {
const response = await axiosClient.get<FaultTree[]>(
'/faultTrees',
'/faultTrees/summaries',
{
headers: authHeaders()
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/systemService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FailureMode } from "@models/failureModeModel";
export const findAll = async (): Promise<System[]> => {
try {
const response = await axiosClient.get<System[]>(
'/systems',
'/systems/summaries',
{
headers: authHeaders()
}
Expand Down

0 comments on commit 78932ca

Please sign in to comment.