Skip to content

Commit

Permalink
Fix schema creation (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
pijng committed Jul 4, 2024
1 parent 431c85f commit b8c6172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info:
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.13.4
version: 1.13.5
externalDocs:
description: Find out more about spec
url: 'https://moonlogs.pages.dev'
Expand Down
3 changes: 2 additions & 1 deletion internal/usecases/schema_usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package usecases

import (
"context"
"errors"
"fmt"
"moonlogs/internal/entities"
"moonlogs/internal/storage"
Expand All @@ -19,7 +20,7 @@ func NewSchemaUseCase(schemaStorage storage.SchemaStorage) *SchemaUseCase {

func (uc *SchemaUseCase) CreateSchema(ctx context.Context, schema entities.Schema) (*entities.Schema, error) {
existingSchema, err := uc.GetSchemaByName(ctx, normalizeName(schema.Name))
if err != nil {
if err != nil && !errors.Is(err, storage.ErrNotFound) {
return nil, fmt.Errorf("failed querying schema by name: %w", err)
}

Expand Down

0 comments on commit b8c6172

Please sign in to comment.