mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +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
|
request.user_id
|
||||||
};
|
};
|
||||||
|
|
||||||
user.profile(std::nothrow, param, [&value]
|
bool modified{true};
|
||||||
|
user.profile(std::nothrow, param, [&value, &modified]
|
||||||
(const string_view &existing)
|
(const string_view &existing)
|
||||||
{
|
{
|
||||||
if(existing == value)
|
modified = existing != value;
|
||||||
throw m::error
|
|
||||||
{
|
|
||||||
http::NOT_MODIFIED, "M_NOT_MODIFIED",
|
|
||||||
"Profile key '%s' already that value"
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(!modified)
|
||||||
|
return resource::response
|
||||||
|
{
|
||||||
|
client, http::OK
|
||||||
|
};
|
||||||
|
|
||||||
const auto eid
|
const auto eid
|
||||||
{
|
{
|
||||||
profile_set(user, sender, param, value)
|
profile_set(user, sender, param, value)
|
||||||
|
|
Loading…
Reference in a new issue