-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5908d2
commit bafb77b
Showing
30 changed files
with
829 additions
and
290 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
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
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,5 +1,5 @@ | ||
import http from '@/api/http' | ||
|
||
const deleteCoterm = (id: string) => http.delete(`/admin/coterms/${id}`) | ||
const deleteCoterm = (id: string) => http.delete(`/api/admin/coterms/${id}`) | ||
|
||
export default deleteCoterm |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { rawDataToCoterm } from '@/api/admin/coterms/getCoterms' | ||
import http from '@/api/http' | ||
|
||
|
||
const getCoterm = async (id: number) => { | ||
const { | ||
data: { data }, | ||
} = await http.get(`/api/admin/coterms/${id}`) | ||
|
||
return rawDataToCoterm(data) | ||
} | ||
|
||
export default getCoterm |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import useSWR from 'swr' | ||
|
||
import getAttachedNodes, { | ||
QueryParams, | ||
} from '@/api/admin/coterms/getAttachedNodes' | ||
|
||
|
||
const useAttachedNodes = ( | ||
id: number, | ||
{ page, query, ...params }: QueryParams | ||
) => { | ||
return useSWR(['admin.coterms.attachedNodes', id, page, query], () => | ||
getAttachedNodes(id, { | ||
page, | ||
query, | ||
...params, | ||
}) | ||
) | ||
} | ||
|
||
export default useAttachedNodes |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Optimistic } from '@/lib/swr' | ||
import { useParams } from 'react-router-dom' | ||
import useSWR, { Key, SWRResponse } from 'swr' | ||
|
||
import getCoterm from '@/api/admin/coterms/getCoterm' | ||
import { Coterm } from '@/api/admin/coterms/getCoterms' | ||
|
||
|
||
export const getKey = (id: number): Key => ['admin.coterms', id] | ||
|
||
const useCotermSWR = () => { | ||
const { cotermId } = useParams() | ||
const id = parseInt(cotermId!) | ||
|
||
return useSWR<Coterm>(getKey(id), () => getCoterm(id), { | ||
revalidateOnMount: false, | ||
}) as Optimistic<SWRResponse<Coterm, any>> | ||
} | ||
|
||
export default useCotermSWR |
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
13 changes: 0 additions & 13 deletions
13
resources/scripts/api/admin/nodes/settings/resetCotermToken.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.