Make sure ApiKeyData set all the fields, remove UserId

This commit is contained in:
nicolas.dorier
2020-03-20 20:00:05 +09:00
parent ad4dbdad6d
commit d2864ccd7c
3 changed files with 3 additions and 9 deletions

View File

@@ -7,7 +7,6 @@ namespace BTCPayServer.Client.Models
{ {
public string ApiKey { get; set; } public string ApiKey { get; set; }
public string Label { get; set; } public string Label { get; set; }
public string UserId { get; set; }
[JsonProperty(ItemConverterType = typeof(PermissionJsonConverter))] [JsonProperty(ItemConverterType = typeof(PermissionJsonConverter))]
public Permission[] Permissions { get; set; } public Permission[] Permissions { get; set; }
} }

View File

@@ -47,8 +47,7 @@ namespace BTCPayServer.Controllers.RestApi
{ {
Permissions = Permission.ToPermissions(data.Permissions).ToArray(), Permissions = Permission.ToPermissions(data.Permissions).ToArray(),
ApiKey = data.Id, ApiKey = data.Id,
UserId = data.UserId, Label = data.Label ?? string.Empty
Label = data.Label
}; };
} }
} }

View File

@@ -335,15 +335,11 @@
"properties": { "properties": {
"apiKey": { "apiKey": {
"type": "string", "type": "string",
"nullable": true "nullable": false
}, },
"label": { "label": {
"type": "string", "type": "string",
"nullable": true "nullable": false
},
"userId": {
"type": "string",
"nullable": true
}, },
"permissions": { "permissions": {
"type": "array", "type": "array",