mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add a theme picker (#11140)
This commit is contained in:
Generated
+71
@@ -45,6 +45,7 @@ curl -X GET http://coder-server:8080/api/v2/users \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
]
|
||||
@@ -112,6 +113,7 @@ curl -X POST http://coder-server:8080/api/v2/users \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -370,6 +372,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -421,6 +424,69 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Responses
|
||||
|
||||
| Status | Meaning | Description | Schema |
|
||||
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- |
|
||||
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) |
|
||||
|
||||
To perform this operation, you must be authenticated. [Learn more](authentication.md).
|
||||
|
||||
## Update user appearance settings
|
||||
|
||||
### Code samples
|
||||
|
||||
```shell
|
||||
# Example request using curl
|
||||
curl -X PUT http://coder-server:8080/api/v2/users/{user}/appearance \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Coder-Session-Token: API_KEY'
|
||||
```
|
||||
|
||||
`PUT /users/{user}/appearance`
|
||||
|
||||
> Body parameter
|
||||
|
||||
```json
|
||||
{
|
||||
"theme_preference": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | In | Type | Required | Description |
|
||||
| ------ | ---- | ------------------------------------------------------------------------------------------------------ | -------- | ----------------------- |
|
||||
| `user` | path | string | true | User ID, name, or me |
|
||||
| `body` | body | [codersdk.UpdateUserAppearanceSettingsRequest](schemas.md#codersdkupdateuserappearancesettingsrequest) | true | New appearance settings |
|
||||
|
||||
### Example responses
|
||||
|
||||
> 200 Response
|
||||
|
||||
```json
|
||||
{
|
||||
"avatar_url": "http://example.com",
|
||||
"created_at": "2019-08-24T14:15:22Z",
|
||||
"email": "user@example.com",
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"login_type": "",
|
||||
"organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"],
|
||||
"roles": [
|
||||
{
|
||||
"display_name": "string",
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1015,6 +1081,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1066,6 +1133,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/roles \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1127,6 +1195,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/roles \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1178,6 +1247,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/activate \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1229,6 +1299,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/suspend \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user