REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.61 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/hooks/use-action/use-action.ts
Text
Base64
import { useNavigate, useLocation } from 'react-router' import { ActionResponse } from '../../../backend/actions/action.interface.js' import { ActionJSON, buildActionCallApiTrigger, buildActionClickHandler } from '../../interfaces/index.js' import { DifferentActionParams, ActionCallCallback, UseActionResult } from './use-action.types.js' import { actionHref } from '../../interfaces/action/action-href.js' import { useActionResponseHandler } from './use-action-response-handler.js' import { useTranslation } from '../use-translation.js' import { useModal } from '../use-modal.js' /** * @load ./use-action.doc.md * @subcategory Hooks * * @param {ActionJSON} action action object * @param {ActionParams} params * @param {ActionCallCallback} onActionCall - callback triggered when action is performed * @return {UseActionResult} * @class * @hideconstructor */ export function useAction<K extends ActionResponse>( action: ActionJSON, params: DifferentActionParams, onActionCall?: ActionCallCallback, ): UseActionResult<K> { const navigate = useNavigate() const location = useLocation() const translateFunctions = useTranslation() const modalFunctions = useModal() const actionResponseHandler = useActionResponseHandler(onActionCall) const href = actionHref(action, params) const callApi = buildActionCallApiTrigger<K>({ action, params, actionResponseHandler, }) const handleClick = buildActionClickHandler({ action, params, actionResponseHandler, navigate, translateFunctions, modalFunctions, location, }) return { href, callApi, handleClick, } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.ts
119 B
lrw-r--r--
2026-02-28 00:32:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-action-response-handler.ts
922 B
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-action.doc.md
550 B
lrw-r--r--
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-action.ts
1.61 KB
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
use-action.types.ts
1.19 KB
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).