Release keys by supplying key model

This commit is contained in:
Pat Hartl 2023-02-11 21:39:06 -06:00
parent 6c2d65e284
commit 1834d0182e

View file

@ -29,13 +29,18 @@ namespace LANCommander.Services
return key;
}
public async Task Release(Guid id)
public async Task<Key> Release(Guid id)
{
var key = await Get(id);
if (key == null)
return;
return null;
return await Release(key);
}
public async Task<Key> Release(Key key)
{
switch (key.AllocationMethod)
{
case KeyAllocationMethod.UserAccount:
@ -49,7 +54,7 @@ namespace LANCommander.Services
break;
}
await Update(key);
return await Update(key);
}
}
}