Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
AchimGrolimund committed Dec 11, 2024
1 parent bc056b8 commit 8a07a58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions cmd/csp-scout-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ import (
"log"
"os"


"github.com/AchimGrolimund/CSP-Scout-API/pkg/application"
"github.com/AchimGrolimund/CSP-Scout-API/pkg/infrastructure/mongodb"
"github.com/AchimGrolimund/CSP-Scout-API/pkg/interfaces/http/handlers"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"github.com/gin-contrib/cors"
)

var (
Build = "raw"
Build = "raw"
Version = "raw"

)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ type ReportData struct {

type Report struct {
ID primitive.ObjectID `bson:"_id" json:"_id"`
Report ReportData `bson:"report" json:"report"`
Report ReportData `bson:"report" json:"report"`
}
4 changes: 2 additions & 2 deletions pkg/infrastructure/mongodb/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ func NewMongoRepository(uri, database, collection string) (*MongoRepository, err

func (r *MongoRepository) Create(ctx context.Context, report domain.Report) error {
collection := r.client.Database(r.database).Collection(r.collection)

_, err := collection.InsertOne(ctx, report)
if err != nil {
return fmt.Errorf("failed to insert report: %v", err)
}

return nil
}

Expand Down

0 comments on commit 8a07a58

Please sign in to comment.