Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(component): modify loaded state
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Nov 23, 2022
1 parent ee33698 commit 2a7f65b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import helper from "./refetch_resource_list"

describe("Helper: resource management/resource list resetter", () => {
it("can clear resource list data and meta count", () => {
const isLoaded = ref(true)
const resourceListData = [ 1, 2, 3 ]
const sampleResourceList = ref({
"data": resourceListData,
Expand All @@ -16,6 +17,7 @@ describe("Helper: resource management/resource list resetter", () => {
async function sampleFetchMethod(): Promise<void> {}

helper(
isLoaded,
sampleResourceList as Ref<any>,
sampleErrors,
sampleIDs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ export default async function<
V extends DeserializedResource<T, U>,
W extends DeserializedResourceListDocument<T, U, V>
>(
isLoaded: Ref<boolean>,
list: Ref<W>,
receivedErrors: Ref<string[]>,
selectedIDs: Ref<string[]>,
fetchResourceInfo: () => Promise<void>
) {
isLoaded.value = false
list.value = {
...list.value,
"data": [],
Expand Down

0 comments on commit 2a7f65b

Please sign in to comment.