Fix tracking report type through the system
This commit is contained in:
parent
5cfd16e6a0
commit
28714b06b8
3 changed files with 5 additions and 1 deletions
|
|
@ -36,7 +36,7 @@ func listCommunication(ctx context.Context, r *http.Request, user platform.User,
|
||||||
Created: report.Created,
|
Created: report.Created,
|
||||||
ID: report.PublicID,
|
ID: report.PublicID,
|
||||||
PublicReport: report,
|
PublicReport: report,
|
||||||
Type: "nuisance",
|
Type: "publicreport." + string(report.Type),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_by_created := func(a, b communication) int {
|
_by_created := func(a, b communication) int {
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,8 @@ func resourceString(t ResourceType) string {
|
||||||
switch t {
|
switch t {
|
||||||
case TypeRMONuisance:
|
case TypeRMONuisance:
|
||||||
return "rmo:nuisance"
|
return "rmo:nuisance"
|
||||||
|
case TypeRMOReport:
|
||||||
|
return "rmo:report"
|
||||||
case TypeRMOWater:
|
case TypeRMOWater:
|
||||||
return "rmo:water"
|
return "rmo:water"
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ type Report struct {
|
||||||
PublicID string `db:"public_id" json:"public_id"`
|
PublicID string `db:"public_id" json:"public_id"`
|
||||||
Reporter types.Contact `db:"reporter" json:"reporter"`
|
Reporter types.Contact `db:"reporter" json:"reporter"`
|
||||||
Status string `db:"status" json:"status"`
|
Status string `db:"status" json:"status"`
|
||||||
|
Type string `db:"report_type" json:"type"`
|
||||||
Water *Water `db:"water" json:"water"`
|
Water *Water `db:"water" json:"water"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,6 +48,7 @@ func ReportsForOrganization(ctx context.Context, org_id int32) ([]*Report, error
|
||||||
"ST_Y(location::geometry::geometry(point, 4326)) AS \"location.latitude\"",
|
"ST_Y(location::geometry::geometry(point, 4326)) AS \"location.latitude\"",
|
||||||
"ST_X(location::geometry::geometry(point, 4326)) AS \"location.longitude\"",
|
"ST_X(location::geometry::geometry(point, 4326)) AS \"location.longitude\"",
|
||||||
"public_id",
|
"public_id",
|
||||||
|
"report_type",
|
||||||
"reporter_email AS \"reporter.email\"",
|
"reporter_email AS \"reporter.email\"",
|
||||||
"reporter_name AS \"reporter.name\"",
|
"reporter_name AS \"reporter.name\"",
|
||||||
"reporter_phone AS \"reporter.phone\"",
|
"reporter_phone AS \"reporter.phone\"",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue