Skip to content

Commit

Permalink
changed template function setstatuscode to accept strings instead of int
Browse files Browse the repository at this point in the history
  • Loading branch information
stuioco authored and tommysitu committed Jul 20, 2024
1 parent 5d9cbab commit 632071f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/templating/template_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,13 @@ func (t templateHelpers) hasJournalKey(indexName, keyValue string, options *raym
return journalEntry != nil
}

func (t templateHelpers) setStatusCode(statusCode int, options *raymond.Options) string {
func (t templateHelpers) setStatusCode(statusCode string, options *raymond.Options) string {
intStatusCode, err := strconv.Atoi(statusCode)
if err != nil {
return ""
}
internalVars := options.ValueFromAllCtx("InternalVars").(map[string]interface{})
internalVars["statusCode"] = statusCode
internalVars["statusCode"] = intStatusCode
return ""
}

Expand Down

0 comments on commit 632071f

Please sign in to comment.