mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/client/profile: Return 200 rather than 304 for put profile dups.
This commit is contained in:
parent
0df06b0b62
commit
e6b06a4522
1 changed files with 9 additions and 7 deletions
|
@ -237,17 +237,19 @@ put__profile(client &client,
|
|||
request.user_id
|
||||
};
|
||||
|
||||
user.profile(std::nothrow, param, [&value]
|
||||
bool modified{true};
|
||||
user.profile(std::nothrow, param, [&value, &modified]
|
||||
(const string_view &existing)
|
||||
{
|
||||
if(existing == value)
|
||||
throw m::error
|
||||
{
|
||||
http::NOT_MODIFIED, "M_NOT_MODIFIED",
|
||||
"Profile key '%s' already that value"
|
||||
};
|
||||
modified = existing != value;
|
||||
});
|
||||
|
||||
if(!modified)
|
||||
return resource::response
|
||||
{
|
||||
client, http::OK
|
||||
};
|
||||
|
||||
const auto eid
|
||||
{
|
||||
profile_set(user, sender, param, value)
|
||||
|
|
Loading…
Reference in a new issue