mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 18:05:43 +08:00
DEV: Document anonymize user api endpoint (#13893)
Adding the anonymize user endpoint to the api docs. See: https://meta.discourse.org/t/158704/7
This commit is contained in:
parent
200a75e4b6
commit
1c60be7658
15
spec/requests/api/schemas/json/user_anonymize_response.json
Normal file
15
spec/requests/api/schemas/json/user_anonymize_response.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"success": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"success",
|
||||||
|
"username"
|
||||||
|
]
|
||||||
|
}
|
@ -337,6 +337,30 @@ describe 'users' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
path '/admin/users/{id}/anonymize.json' do
|
||||||
|
put 'Anonymize a user' do
|
||||||
|
tags 'Users', 'Admin'
|
||||||
|
consumes 'application/json'
|
||||||
|
expected_request_schema = nil
|
||||||
|
|
||||||
|
parameter name: :id, in: :path, type: :integer, required: true
|
||||||
|
|
||||||
|
produces 'application/json'
|
||||||
|
response '200', 'response' do
|
||||||
|
|
||||||
|
let(:id) { Fabricate(:user).id }
|
||||||
|
|
||||||
|
expected_response_schema = load_spec_schema('user_anonymize_response')
|
||||||
|
schema(expected_response_schema)
|
||||||
|
|
||||||
|
it_behaves_like "a JSON endpoint", 200 do
|
||||||
|
let(:expected_response_schema) { expected_response_schema }
|
||||||
|
let(:expected_request_schema) { expected_request_schema }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
path '/admin/users/{id}/log_out.json' do
|
path '/admin/users/{id}/log_out.json' do
|
||||||
|
|
||||||
post 'Log a user out' do
|
post 'Log a user out' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user