@@ -108,7 +108,7 @@ func (s FrameworkService) RequestExport(
|
||||
var exportJobID gid.GID
|
||||
exportJob := &coredata.ExportJob{}
|
||||
|
||||
err := s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
||||
err := s.svc.pg.WithTx(ctx, func(ctx context.Context, conn pg.Tx) error {
|
||||
framework := &coredata.Framework{}
|
||||
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
|
||||
return fmt.Errorf("cannot load framework: %w", err)
|
||||
@@ -160,7 +160,7 @@ func (s FrameworkService) Export(
|
||||
|
||||
return s.svc.pg.WithTx(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
func(ctx context.Context, conn pg.Tx) error {
|
||||
framework := &coredata.Framework{}
|
||||
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
|
||||
return fmt.Errorf("cannot load framework: %w", err)
|
||||
@@ -353,7 +353,7 @@ func (s FrameworkService) Create(
|
||||
UpdatedAt: now,
|
||||
}
|
||||
|
||||
err := s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
||||
err := s.svc.pg.WithTx(ctx, func(ctx context.Context, conn pg.Tx) error {
|
||||
if err := organization.LoadByID(ctx, conn, s.svc.scope, req.OrganizationID); err != nil {
|
||||
return fmt.Errorf("cannot load organization: %w", err)
|
||||
}
|
||||
@@ -380,7 +380,7 @@ func (s FrameworkService) CountForOrganizationID(
|
||||
) (int, error) {
|
||||
var count int
|
||||
|
||||
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) (err error) {
|
||||
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) (err error) {
|
||||
frameworks := &coredata.Frameworks{}
|
||||
count, err = frameworks.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID)
|
||||
if err != nil {
|
||||
@@ -404,7 +404,7 @@ func (s FrameworkService) ListForOrganizationID(
|
||||
var frameworks coredata.Frameworks
|
||||
organization := &coredata.Organization{}
|
||||
|
||||
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
||||
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
|
||||
if err := organization.LoadByID(ctx, conn, s.svc.scope, organizationID); err != nil {
|
||||
return fmt.Errorf("cannot load organization: %w", err)
|
||||
}
|
||||
@@ -436,7 +436,7 @@ func (s FrameworkService) Get(
|
||||
) (*coredata.Framework, error) {
|
||||
framework := &coredata.Framework{}
|
||||
|
||||
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
||||
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
|
||||
return framework.LoadByID(ctx, conn, s.svc.scope, frameworkID)
|
||||
})
|
||||
|
||||
@@ -455,7 +455,7 @@ func (s FrameworkService) GetByIDs(
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
func(ctx context.Context, conn pg.Querier) error {
|
||||
if err := frameworks.LoadByIDs(
|
||||
ctx,
|
||||
conn,
|
||||
@@ -485,7 +485,7 @@ func (s FrameworkService) Update(
|
||||
|
||||
framework := &coredata.Framework{ID: req.ID}
|
||||
|
||||
err := s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
||||
err := s.svc.pg.WithTx(ctx, func(ctx context.Context, conn pg.Tx) error {
|
||||
if err := framework.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
|
||||
return fmt.Errorf("cannot load framework: %w", err)
|
||||
}
|
||||
@@ -513,8 +513,8 @@ func (s FrameworkService) Delete(
|
||||
) error {
|
||||
framework := &coredata.Framework{}
|
||||
|
||||
return s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
||||
return framework.Delete(ctx, conn, s.svc.scope, frameworkID)
|
||||
return s.svc.pg.WithTx(ctx, func(ctx context.Context, tx pg.Tx) error {
|
||||
return framework.Delete(ctx, tx, s.svc.scope, frameworkID)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ func (s FrameworkService) Import(
|
||||
frameworkID := gid.New(organizationID.TenantID(), coredata.FrameworkEntityType)
|
||||
now := time.Now()
|
||||
|
||||
err := s.svc.pg.WithTx(ctx, func(tx pg.Conn) error {
|
||||
err := s.svc.pg.WithTx(ctx, func(ctx context.Context, tx pg.Tx) error {
|
||||
organization := &coredata.Organization{}
|
||||
if err := organization.LoadByID(ctx, tx, s.svc.scope, organizationID); err != nil {
|
||||
return fmt.Errorf("cannot load organization: %w", err)
|
||||
@@ -649,7 +649,7 @@ func (s FrameworkService) SendExportEmail(
|
||||
) error {
|
||||
return s.svc.pg.WithTx(
|
||||
ctx,
|
||||
func(tx pg.Conn) error {
|
||||
func(ctx context.Context, tx pg.Tx) error {
|
||||
file := &coredata.File{}
|
||||
if err := file.LoadByID(ctx, tx, s.svc.scope, fileID); err != nil {
|
||||
return fmt.Errorf("cannot load file: %w", err)
|
||||
@@ -719,7 +719,7 @@ func (s *FrameworkService) BuildAndUploadExport(ctx context.Context, exportJobID
|
||||
exportJob := &coredata.ExportJob{}
|
||||
err := s.svc.pg.WithTx(
|
||||
ctx,
|
||||
func(tx pg.Conn) error {
|
||||
func(ctx context.Context, tx pg.Tx) error {
|
||||
if err := exportJob.LoadByID(ctx, tx, s.svc.scope, exportJobID); err != nil {
|
||||
return fmt.Errorf("cannot load export job: %w", err)
|
||||
}
|
||||
@@ -823,7 +823,7 @@ func (s FrameworkService) GenerateLightLogoURL(
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
func(ctx context.Context, conn pg.Querier) error {
|
||||
framework := &coredata.Framework{}
|
||||
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
|
||||
return fmt.Errorf("cannot load framework: %w", err)
|
||||
@@ -865,7 +865,7 @@ func (s FrameworkService) GenerateDarkLogoURL(
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
func(ctx context.Context, conn pg.Querier) error {
|
||||
framework := &coredata.Framework{}
|
||||
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
|
||||
return fmt.Errorf("cannot load framework: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user