add mask tab
This commit is contained in:
@@ -135,7 +135,7 @@ export async function runPlugin(
|
||||
body: JSON.stringify({
|
||||
name,
|
||||
image: imageBase64,
|
||||
scale:upscale,
|
||||
scale: upscale,
|
||||
clicks,
|
||||
}),
|
||||
})
|
||||
@@ -167,6 +167,23 @@ export async function getMediaFile(tab: string, filename: string) {
|
||||
throw new Error(errMsg.errors)
|
||||
}
|
||||
|
||||
export async function getMediaBlob(tab: string, filename: string) {
|
||||
const res = await fetch(
|
||||
`${API_ENDPOINT}/media_file?tab=${tab}&filename=${encodeURIComponent(
|
||||
filename
|
||||
)}`,
|
||||
{
|
||||
method: "GET",
|
||||
}
|
||||
)
|
||||
if (res.ok) {
|
||||
const blob = await res.blob()
|
||||
return blob
|
||||
}
|
||||
const errMsg = await res.json()
|
||||
throw new Error(errMsg.errors)
|
||||
}
|
||||
|
||||
export async function getMedias(tab: string): Promise<Filename[]> {
|
||||
const res = await api.get(`medias`, { params: { tab } })
|
||||
return res.data
|
||||
|
||||
Reference in New Issue
Block a user