-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
It's not always that we are fetching things directly via OpenFetch.
One example is PrimeVue's Upload component which takes an url an handles the post for you.
My idea was to have a composable like this:
const { path, responseType } = useApiPath('v1/files');
The path in this case would be http://localhost:1234/v1/files.
In the PrimeVue upload example that would look like this:
const { path, responseType } = useApiPath('v1/files');
<FileUpload
name="files"
:multiple="true"
accept="image/*"
:url="path"
>
<template #empty>
<span>Drag and drop files to here to upload.</span>
</template>
</FileUpload>
I can see how it could be a bit out of scope for this project. But it would allow to use the type safety even for other things than fetching directly.
Metadata
Metadata
Assignees
Labels
No labels