[WIKI-804] fix: refactor image uploader (#8210)
* fix: refactor uploader * fix: props * fix: sites fix
This commit is contained in:
parent
392c8cf2e1
commit
82c970ac4b
9 changed files with 63 additions and 56 deletions
|
|
@ -98,10 +98,10 @@ export class SitesFileService extends FileService {
|
|||
* @returns {Promise<void>} Promise resolving to void
|
||||
* @throws {Error} If the request fails
|
||||
*/
|
||||
async restoreNewAsset(workspaceSlug: string, src: string): Promise<void> {
|
||||
async restoreNewAsset(anchor: string, src: string): Promise<void> {
|
||||
// remove the last slash and get the asset id
|
||||
const assetId = getAssetIdFromUrl(src);
|
||||
return this.post(`/api/public/assets/v2/workspaces/${workspaceSlug}/restore/${assetId}/`)
|
||||
return this.post(`/api/public/assets/v2/anchor/${anchor}/restore/${assetId}/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue