report Location Problem
abstract suspend fun reportLocationProblem(locationId: Long, report: LocationProblemReport): AFResult
Reports a problem about an existing location, carrying the member's corrections as a structured patch (see LocationProblemReport).
Use it when the member says a location's details are wrong, it closed, or it is listed twice - pick one of the six com.advantahealth.api.locations.model.LocationProblemType values and fill only the corrections the member typed. It has no facilities() counterpart.
Android (Kotlin)
lifecycleScope.launch {
try {
val report = LocationProblemReport(
problemType = LocationProblemType.INCORRECT_ADDRESS,
description = "The entrance moved to Oak Street.",
addressLine1 = "45 Oak St"
)
val result = AFCore.locations().reportLocationProblem(locationId = marker.id, report = report)
showConfirmation(result.statusMessage)
} catch (t: Throwable) {
showError(t)
}
}Content copied to clipboard
iOS (Swift)
Task {
do {
let report = LocationProblemReport(
problemType: .incorrectAddress,
description: "The entrance moved to Oak Street.",
name: nil,
locationCategoryId: nil,
locationTypeId: nil,
addressLine1: "45 Oak St",
addressLine2: nil,
city: nil,
stateProvince: nil,
postalCode: nil,
countryCode: nil,
latitude: nil,
longitude: nil
)
let result = try await AFCore.shared.locations().reportLocationProblem(locationId: marker.id, report: report)
showConfirmation(result.statusMessage)
} catch {
showError(error)
}
}Content copied to clipboard
Return
AFResult with status = true, the server's confirmation message and its success code in messageCode (HTTP 201). The report goes to a triage queue and also appears in getMySubmissions.
Parameters
location Id
Canonical id of the location the report is about.
report
The problem and the optional corrections.
Throws
if the report is rejected.