Remove file deletion functions

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-10-08 18:32:37 +02:00
parent 39ed524f4f
commit 04fc1bfa9d
3 changed files with 0 additions and 38 deletions

View File

@@ -153,21 +153,3 @@ WHERE %s
return err
}
func (f File) HardDelete(ctx context.Context, conn pg.Conn, scope Scoper) (*string, error) {
q := `
DELETE FROM files
WHERE %s
AND id = @file_id
RETURNING file_key
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"file_id": f.ID}
maps.Copy(args, scope.SQLArguments())
var vcrFileKey *string
err := conn.QueryRow(ctx, q, args).Scan(&vcrFileKey)
return vcrFileKey, err
}

View File

@@ -146,18 +146,6 @@ func (s FileService) UploadAndSaveFile(
return file, nil
}
func (s FileService) DeleteFileFromS3(ctx context.Context, fileKey string) error {
_, err := s.svc.s3.DeleteObject(ctx, &s3.DeleteObjectInput{
Bucket: aws.String(s.svc.bucket),
Key: aws.String(fileKey),
})
if err != nil {
return fmt.Errorf("failed to delete object from S3: %w", err)
}
return nil
}
func (s FileService) GenerateFileTempURL(
ctx context.Context,
fileID gid.GID,

View File

@@ -66,14 +66,6 @@ func (s ReportService) Delete(
return fmt.Errorf("cannot get report: %w", err)
}
_, err = s.svc.s3.DeleteObject(ctx, &s3.DeleteObjectInput{
Bucket: aws.String(s.svc.bucket),
Key: aws.String(report.ObjectKey),
})
if err != nil {
return fmt.Errorf("cannot delete report from S3: %w", err)
}
err = report.Delete(ctx, conn, s.svc.scope)
if err != nil {
return fmt.Errorf("cannot delete report: %w", err)