discourse/spec/requests/api/schemas/json/badge_create_response.json
Martin Brennan 77081de027
FIX: Badge image uploader (#28188)
In the formkit conversion in 2ca06ba236
we missed setting a type for the UppyImageUploader for badges. Also,
we were not passing down the `image_url` as form data, so when we used
`data.image` for that field the badge was not updating in the UI after
page loads and the image URL was not loading for preview.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-08-01 15:36:17 +02:00

142 lines
2.7 KiB
JSON

{
"additionalProperties": false,
"properties": {
"badge_types": {
"type": "array",
"items":
{
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"sort_order": {
"type": "integer"
}
},
"required": [
"id",
"name",
"sort_order"
]
}
},
"badge": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"grant_count": {
"type": "integer"
},
"allow_title": {
"type": "boolean"
},
"multiple_grant": {
"type": "boolean"
},
"icon": {
"type": "string"
},
"image_url": {
"type": [
"string",
"null"
]
},
"image_upload_id": {
"type": [
"integer",
"null"
]
},
"listable": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"badge_grouping_id": {
"type": "integer"
},
"system": {
"type": "boolean"
},
"long_description": {
"type": "string"
},
"slug": {
"type": "string"
},
"manually_grantable": {
"type": "boolean"
},
"query": {
"type": [
"string",
"null"
]
},
"trigger": {
"type": [
"string",
"null"
]
},
"target_posts": {
"type": "boolean"
},
"auto_revoke": {
"type": "boolean"
},
"show_posts": {
"type": "boolean"
},
"badge_type_id": {
"type": "integer"
}
},
"required": [
"id",
"name",
"description",
"grant_count",
"allow_title",
"multiple_grant",
"icon",
"image_url",
"listable",
"enabled",
"badge_grouping_id",
"system",
"long_description",
"slug",
"manually_grantable",
"query",
"trigger",
"target_posts",
"auto_revoke",
"show_posts",
"badge_type_id",
"image_upload_id"
]
}
},
"required": [
"badge_types",
"badge"
]
}