Skip to content

Commit ddd1735

Browse files
aashimgargbhavabhuthi
authored andcommitted
add resource modal
1 parent 917dc34 commit ddd1735

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/DistributionList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export const createResourceFilesDoc: any = graphql(`
119119
id
120120
created
121121
name
122+
type
122123
}
123124
}
124125
`);

app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/ResourceListView.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ export const ResourceListView = ({ data, refetch }: any) => {
7171
GraphQL(createResourceFilesDoc, data),
7272
{
7373
onSuccess: (data: any) => {
74+
const updatedRows = data.createFileResources.map((item: any) => ({
75+
name_of_resource: item.name,
76+
type: item.type,
77+
date_added: formatDate(item.created),
78+
id: item.id,
79+
}));
80+
81+
setFilteredRows((prevRows: FilteredRow[]) => [
82+
...prevRows,
83+
...updatedRows,
84+
]);
85+
7486
refetch();
7587
toast('Resource Added Successfully', {
7688
action: {
@@ -201,7 +213,7 @@ export const ResourceListView = ({ data, refetch }: any) => {
201213
name="Search"
202214
onChange={(e) => handleSearchChange(e)}
203215
/>
204-
{/* <Dialog>
216+
<Dialog>
205217
<Dialog.Trigger>
206218
<Button size="medium" className=" mx-5">
207219
ADD NEW RESOURCE
@@ -213,7 +225,7 @@ export const ResourceListView = ({ data, refetch }: any) => {
213225
{file.length === 0 && <DropZone.FileUpload />}
214226
</DropZone>
215227
</Dialog.Content>
216-
</Dialog> */}
228+
</Dialog>
217229
</div>
218230
<DataTable
219231
columns={filteredColumns}

0 commit comments

Comments
 (0)