forked from MapComplete/MapComplete
Refactoring: move download functionality for OsmObjects into a new object
This commit is contained in:
parent
8eb2c68f79
commit
1f9aacfb29
23 changed files with 633 additions and 901 deletions
|
@ -8,6 +8,7 @@ import { And } from "../../Tags/And"
|
|||
import { Tag } from "../../Tags/Tag"
|
||||
import { OsmId } from "../../../Models/OsmFeature"
|
||||
import { Utils } from "../../../Utils"
|
||||
import OsmObjectDownloader from "../OsmObjectDownloader";
|
||||
|
||||
export default class DeleteAction extends OsmChangeAction {
|
||||
private readonly _softDeletionTags: TagsFilter
|
||||
|
@ -71,8 +72,12 @@ export default class DeleteAction extends OsmChangeAction {
|
|||
changes: Changes,
|
||||
object?: OsmObject
|
||||
): Promise<ChangeDescription[]> {
|
||||
const osmObject = object ?? (await OsmObject.DownloadObjectAsync(this._id))
|
||||
const osmObject = object ?? (await new OsmObjectDownloader(changes.backend, changes).DownloadObjectAsync(this._id))
|
||||
|
||||
if(osmObject === "deleted"){
|
||||
// already deleted in the meantime - no more changes necessary
|
||||
return []
|
||||
}
|
||||
if (this._hardDelete) {
|
||||
return [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue