Skip to content

Commit

Permalink
refactor: remove ineffective if in Publishers POST
Browse files Browse the repository at this point in the history
  • Loading branch information
bfabio committed Oct 4, 2022
1 parent ce3bd7c commit d07ffb2
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions internal/handlers/publishers.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,13 @@ func (p *Publisher) PostPublisher(ctx *fiber.Ctx) error {
normalizedEmail := common.NormalizeEmail(request.Email)

publisher := &models.Publisher{
ID: utils.UUIDv4(),
Email: normalizedEmail,
Active: request.Active,
ID: utils.UUIDv4(),
Description: &request.Description,
Email: normalizedEmail,
Active: request.Active,
ExternalCode: &request.ExternalCode,
}

if request.ExternalCode != "" {
publisher.ExternalCode = &request.ExternalCode
}

if request.Description != "" {
publisher.Description = &request.Description
}

publisher.Description = &request.Description

for _, codeHost := range request.CodeHosting {
urlAddress, _ := url.Parse(codeHost.URL)
normalizedURL := purell.NormalizeURL(urlAddress, normalizeFlags)
Expand Down

0 comments on commit d07ffb2

Please sign in to comment.