[WIKI-804] fix: refactor image uploader (#8210)

* fix: refactor uploader

* fix: props

* fix: sites fix
This commit is contained in:
M. Palanikannan 2025-12-05 13:20:15 +05:30 committed by GitHub
parent 392c8cf2e1
commit 82c970ac4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 63 additions and 56 deletions

View file

@ -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;