Compare commits

...
4 Commits
Author SHA1 Message Date
niggl 1d068b2655 docs(swagger): New swaggerdoc
ci/woodpecker/push/build Pipeline was successful
2024-12-12 18:50:21 +01:00
niggl ef25adf5ed refactor(models): Group now only has a name
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/tag/release Pipeline was successful
2024-12-12 18:48:39 +01:00
niggl c09c00ec68 feat(pdfs): Set download names for pdf generation responses
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
2024-12-12 18:24:07 +01:00
niggl 1f4981b0a9 fix(config): Don't fail on missing env
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/tag/release Pipeline was successful
2024-12-12 18:18:41 +01:00
8 changed files with 5 additions and 23 deletions

No files matched your search

-7
View File
@@ -312,18 +312,11 @@ const docTemplate = `{
"models.Group": { "models.Group": {
"type": "object", "type": "object",
"required": [ "required": [
"id",
"name" "name"
], ],
"properties": { "properties": {
"id": {
"type": "integer"
},
"name": { "name": {
"type": "string" "type": "string"
},
"parent_group": {
"$ref": "#/definitions/models.Group"
} }
} }
}, },
-7
View File
@@ -303,18 +303,11 @@
"models.Group": { "models.Group": {
"type": "object", "type": "object",
"required": [ "required": [
"id",
"name" "name"
], ],
"properties": { "properties": {
"id": {
"type": "integer"
},
"name": { "name": {
"type": "string" "type": "string"
},
"parent_group": {
"$ref": "#/definitions/models.Group"
} }
} }
}, },
-5
View File
@@ -94,14 +94,9 @@ definitions:
type: object type: object
models.Group: models.Group:
properties: properties:
id:
type: integer
name: name:
type: string type: string
parent_group:
$ref: '#/definitions/models.Group'
required: required:
- id
- name - name
type: object type: object
models.Runner: models.Runner:
+1
View File
@@ -69,6 +69,7 @@ func (h *DefaultHandler) GenerateCard(c *fiber.Ctx) error {
} }
c.Set(fiber.HeaderContentType, "application/pdf") c.Set(fiber.HeaderContentType, "application/pdf")
c.Set(fiber.HeaderContentDisposition, "attachment; filename=runner-cards.pdf")
return c.Send(pdf) return c.Send(pdf)
} }
+1
View File
@@ -69,6 +69,7 @@ func (h *DefaultHandler) GenerateCertificate(c *fiber.Ctx) error {
} }
c.Set(fiber.HeaderContentType, "application/pdf") c.Set(fiber.HeaderContentType, "application/pdf")
c.Set(fiber.HeaderContentDisposition, "attachment; filename=certificate.pdf")
return c.Send(pdf) return c.Send(pdf)
} }
+1
View File
@@ -72,6 +72,7 @@ func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error {
} }
c.Set(fiber.HeaderContentType, "application/pdf") c.Set(fiber.HeaderContentType, "application/pdf")
c.Set(fiber.HeaderContentDisposition, "attachment; filename=runner-contracts.pdf")
return c.Send(pdf) return c.Send(pdf)
} }
+1 -1
View File
@@ -45,7 +45,7 @@ func loadEnv() error {
viper.AutomaticEnv() viper.AutomaticEnv()
err := viper.ReadInConfig() err := viper.ReadInConfig()
if err != nil { if err != nil {
return err log.Println("No .env file found")
} }
// Unmarshal the config from file and env into the config struct // Unmarshal the config from file and env into the config struct
+1 -3
View File
@@ -14,9 +14,7 @@ type Runner struct {
} }
type Group struct { type Group struct {
ID int `json:"id" validate:"required"` Name string `json:"name" validate:"required"`
Name string `json:"name" validate:"required"`
ParentGroup *Group `json:"parent_group" validate:"optional"`
} }
type ContractTemplateOptions struct { type ContractTemplateOptions struct {