Skip to content
Snippets Groups Projects
Unverified Commit f74bc309 authored by syuilo's avatar syuilo
Browse files

Fix bug

parent bc83963a
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import $ from 'cafy';
import { publishMainStream } from '../../../../services/stream';
import define from '../../define';
import { UserProfiles } from '../../../../models';
import { ensure } from '../../../../prelude/ensure';
export const meta = {
requireCredential: true,
......@@ -20,11 +21,13 @@ export const meta = {
};
export default define(meta, async (ps, user) => {
const profile = await UserProfiles.findOne(user.id).then(ensure);
await UserProfiles.createQueryBuilder().update()
.set({
clientData: {
clientData: Object.assign(profile.clientData, {
[ps.name]: ps.value
},
}),
})
.where('userId = :id', { id: user.id })
.execute();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment