1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

fix tag removal

This commit is contained in:
Kyle Spearrin 2017-11-14 09:35:48 -05:00
parent 49f4a773dc
commit 41ca2a64a9

View File

@ -117,7 +117,7 @@ namespace Bit.Core.Services
}
catch(Exception e)
{
if(!e.Message.Contains("(400) Bad Request"))
if(e.InnerException == null || !e.InnerException.Message.Contains("(404) Not Found"))
{
throw e;
}
@ -145,10 +145,18 @@ namespace Bit.Core.Services
var operation = new PartialUpdateOperation
{
Operation = op,
Path = "/tags",
Value = tag
Path = "/tags"
};
if(op == UpdateOperationType.Add)
{
operation.Value = tag;
}
else if(op == UpdateOperationType.Remove)
{
operation.Path += $"/{tag}";
}
foreach(var id in deviceIds)
{
try
@ -157,7 +165,7 @@ namespace Bit.Core.Services
}
catch(Exception e)
{
if(!e.Message.Contains("(400) Bad Request"))
if(e.InnerException == null || !e.InnerException.Message.Contains("(404) Not Found"))
{
throw e;
}