Add vendor compliance reports UI
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -63,6 +63,7 @@ func (vcs *VendorComplianceReports) LoadForVendorID(
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
vendor_id,
|
||||
report_date,
|
||||
valid_until,
|
||||
report_name,
|
||||
@@ -199,7 +200,8 @@ func (vcr *VendorComplianceReport) Delete(
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM
|
||||
DELETE
|
||||
FROM
|
||||
vendor_compliance_reports
|
||||
WHERE
|
||||
%s
|
||||
@@ -208,7 +210,8 @@ WHERE
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.NamedArgs{"id": vcr.ID}
|
||||
args := pgx.StrictNamedArgs{"id": vcr.ID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
return err
|
||||
|
||||
@@ -186,10 +186,16 @@ func (s VendorComplianceReportService) Delete(
|
||||
) error {
|
||||
vendorComplianceReport := &coredata.VendorComplianceReport{ID: vendorComplianceReportID}
|
||||
|
||||
return s.svc.pg.WithConn(
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
return vendorComplianceReport.Delete(ctx, conn, s.svc.scope)
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete vendor compliance report: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user