Pass-through an address shim with whatever data we have
This commit is contained in:
parent
d1ba2f53fa
commit
28cf7683a7
1 changed files with 24 additions and 18 deletions
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"github.com/Gleipnir-Technology/bob/dialect/psql"
|
"github.com/Gleipnir-Technology/bob/dialect/psql"
|
||||||
"github.com/Gleipnir-Technology/bob/dialect/psql/sm"
|
"github.com/Gleipnir-Technology/bob/dialect/psql/sm"
|
||||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||||
querypublic "github.com/Gleipnir-Technology/nidus-sync/db/query/public"
|
|
||||||
querypublicreport "github.com/Gleipnir-Technology/nidus-sync/db/query/publicreport"
|
|
||||||
modelpublic "github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/model"
|
modelpublic "github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/model"
|
||||||
modelpublicreport "github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/publicreport/model"
|
modelpublicreport "github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/publicreport/model"
|
||||||
|
querypublic "github.com/Gleipnir-Technology/nidus-sync/db/query/public"
|
||||||
|
querypublicreport "github.com/Gleipnir-Technology/nidus-sync/db/query/publicreport"
|
||||||
"github.com/Gleipnir-Technology/nidus-sync/platform/types"
|
"github.com/Gleipnir-Technology/nidus-sync/platform/types"
|
||||||
//"github.com/google/uuid"
|
//"github.com/google/uuid"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
|
@ -80,6 +80,8 @@ func reportQueryToRows(ctx context.Context, reports []modelpublicreport.Report,
|
||||||
report_ids[i] = report.ID
|
report_ids[i] = report.ID
|
||||||
if report.AddressID != nil {
|
if report.AddressID != nil {
|
||||||
address_ids = append(address_ids, int64(*report.AddressID))
|
address_ids = append(address_ids, int64(*report.AddressID))
|
||||||
|
} else {
|
||||||
|
log.Debug().Int32("id", report.ID).Msg("has no address")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
images_by_id, err := loadImagesForReport(ctx, report_ids)
|
images_by_id, err := loadImagesForReport(ctx, report_ids)
|
||||||
|
|
@ -124,7 +126,11 @@ func reportQueryToRows(ctx context.Context, reports []modelpublicreport.Report,
|
||||||
address = &a
|
address = &a
|
||||||
}
|
}
|
||||||
if address == nil {
|
if address == nil {
|
||||||
return nil, fmt.Errorf("nil address: %w", err)
|
address = &types.Address{
|
||||||
|
ID: row.AddressID,
|
||||||
|
GID: row.AddressGid,
|
||||||
|
Raw: row.AddressRaw,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
results[i] = types.PublicReport{
|
results[i] = types.PublicReport{
|
||||||
Address: *address,
|
Address: *address,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue