mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 21:48:12 -05:00
added expiration date and creator identifier to the Send access response model (#1166)
This commit is contained in:
parent
2f7c2a64e0
commit
b21c9042ca
@ -60,7 +60,12 @@ namespace Bit.Api.Controllers
|
|||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ObjectResult(new SendAccessResponseModel(send, _globalSettings));
|
var sendResponse = new SendAccessResponseModel(send, _globalSettings);
|
||||||
|
if (send.UserId.HasValue) {
|
||||||
|
var creator = await _userService.GetUserByIdAsync(send.UserId.Value);
|
||||||
|
sendResponse.CreatorIdentifier = creator.Email;
|
||||||
|
}
|
||||||
|
return new ObjectResult(sendResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
|
@ -4,6 +4,7 @@ using Bit.Core.Models.Data;
|
|||||||
using Bit.Core.Models.Table;
|
using Bit.Core.Models.Table;
|
||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Bit.Core.Settings;
|
using Bit.Core.Settings;
|
||||||
|
using Bit.Core.Services;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Bit.Core.Models.Api
|
namespace Bit.Core.Models.Api
|
||||||
@ -39,6 +40,7 @@ namespace Bit.Core.Models.Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
Name = sendData.Name;
|
Name = sendData.Name;
|
||||||
|
ExpirationDate = send.ExpirationDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
@ -46,5 +48,7 @@ namespace Bit.Core.Models.Api
|
|||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public SendFileModel File { get; set; }
|
public SendFileModel File { get; set; }
|
||||||
public SendTextModel Text { get; set; }
|
public SendTextModel Text { get; set; }
|
||||||
|
public DateTime? ExpirationDate { get; set; }
|
||||||
|
public string CreatorIdentifier { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user