feature: allow to delete all activities of a user (#1880)
* Allow to delete all activities of a user * Update changelog
This commit is contained in:
@@ -138,6 +138,23 @@ export class ActivitiesPageComponent implements OnDestroy, OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
public onDeleteAllActivities() {
|
||||
const confirmation = confirm(
|
||||
$localize`Do you really want to delete all your activities?`
|
||||
);
|
||||
|
||||
if (confirmation) {
|
||||
this.dataService
|
||||
.deleteAllOrders()
|
||||
.pipe(takeUntil(this.unsubscribeSubject))
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.fetchActivities();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public onExport(activityIds?: string[]) {
|
||||
this.dataService
|
||||
.fetchExport(activityIds)
|
||||
|
@@ -13,6 +13,7 @@
|
||||
(activityDeleted)="onDeleteActivity($event)"
|
||||
(activityToClone)="onCloneActivity($event)"
|
||||
(activityToUpdate)="onUpdateActivity($event)"
|
||||
(deleteAllActivities)="onDeleteAllActivities()"
|
||||
(export)="onExport($event)"
|
||||
(exportDrafts)="onExportDrafts($event)"
|
||||
(import)="onImport()"
|
||||
|
@@ -146,6 +146,10 @@ export class DataService {
|
||||
return this.http.delete<any>(`/api/v1/account/${aId}`);
|
||||
}
|
||||
|
||||
public deleteAllOrders() {
|
||||
return this.http.delete<any>(`/api/v1/order/`);
|
||||
}
|
||||
|
||||
public deleteOrder(aId: string) {
|
||||
return this.http.delete<any>(`/api/v1/order/${aId}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user