MOBILE-2825 workshop: Delete offline files after sync
parent
0c428eb257
commit
5e098c981b
|
@ -353,7 +353,15 @@ export class AddonModWorkshopSyncProvider extends CoreSyncBaseProvider {
|
||||||
result.updated = true;
|
result.updated = true;
|
||||||
|
|
||||||
return this.workshopOffline.deleteSubmissionAction(action.workshopid, action.submissionid, action.action,
|
return this.workshopOffline.deleteSubmissionAction(action.workshopid, action.submissionid, action.action,
|
||||||
siteId);
|
siteId).then(() => {
|
||||||
|
// Delete stored files.
|
||||||
|
if (action.action == 'add' || action.action == 'update') {
|
||||||
|
const editing = action.action == 'update';
|
||||||
|
|
||||||
|
return this.workshopHelper.deleteSubmissionStoredFiles(action.workshopid,
|
||||||
|
action.submissionid, editing, siteId);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -433,7 +441,9 @@ export class AddonModWorkshopSyncProvider extends CoreSyncBaseProvider {
|
||||||
// Delete the offline data.
|
// Delete the offline data.
|
||||||
result.updated = true;
|
result.updated = true;
|
||||||
|
|
||||||
return this.workshopOffline.deleteAssessment(workshop.id, assessmentId, siteId);
|
return this.workshopOffline.deleteAssessment(workshop.id, assessmentId, siteId).then(() => {
|
||||||
|
this.workshopHelper.deleteAssessmentStoredFiles(workshop.id, assessmentId, siteId);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (discardError) {
|
if (discardError) {
|
||||||
|
|
Loading…
Reference in New Issue