-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dynamic-overview): retrieval data only when behaviorId is provided
- Loading branch information
1 parent
fed46a8
commit d588a04
Showing
5 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import { SaferwallClient } from '$lib/clients/saferwall'; | ||
import { redirect } from '@sveltejs/kit'; | ||
import type { PageLoad } from '../$types'; | ||
import type { Saferwall } from '$lib/types'; | ||
|
||
export const load: PageLoad = async ({ parent }) => { | ||
const { | ||
session, | ||
file: { default_behavior_id } | ||
file: { default_behavior_id: behaviorId } | ||
} = await parent(); | ||
|
||
const processArray = await new SaferwallClient(session).getFileProcessTree(default_behavior_id); | ||
if (!behaviorId) { | ||
throw redirect(307, './'); | ||
} | ||
|
||
const processArray = await new SaferwallClient(session).getFileProcessTree(behaviorId); | ||
return { | ||
processArray, | ||
behaviorId: default_behavior_id | ||
behaviorId, | ||
processArray | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters