diff --git a/CHANGELOG.md b/CHANGELOG.md index 76a1971..77c40e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,13 @@ ## Added +- Chat between users. (chat history). - About description for user and `last_login` column date - Updating info api route of authorized user ### Fix +- Fixed updating user info - Cleaning up session store before starting websocket server ## [1.1.0] - 2022-01-31 diff --git a/app/Services/MeService.ts b/app/Services/MeService.ts index 15c74f4..0343a3b 100644 --- a/app/Services/MeService.ts +++ b/app/Services/MeService.ts @@ -314,6 +314,7 @@ export default class MeService { auth: AuthContract ): Promise { const user = await auth.use(this.authGuard).authenticate(); + const { about, ...newContacts } = data; if (Object.keys(data).length === 0) { return { @@ -330,7 +331,7 @@ export default class MeService { /** * Personal info updating */ - if (data.about !== undefined) { + if (about !== undefined) { await this.userRepository.updateInfo(user.id, data); } @@ -338,15 +339,10 @@ export default class MeService { * Contacts updating */ if (data.phone_number !== undefined || data.twitter_id !== undefined || data.telegram_id !== undefined) { - const contacts = await this.contactRepository.update(user, { - phone_number: data.phone_number, - twitter_id: data.twitter_id, - telegram_id: data.telegram_id, - vk_id: data.vk_id, - }); + const contacts = await this.contactRepository.update(user, newContacts); if (!contacts) { - await this.contactRepository.create(user, data); + await this.contactRepository.create(user, newContacts); } } diff --git a/config/cloudinary.ts b/config/cloudinary.ts deleted file mode 100644 index 17782fd..0000000 --- a/config/cloudinary.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Env from '@ioc:Adonis/Core/Env'; -import { CloudinaryConfig } from '@ioc:Adonis/Addons/Cloudinary'; - -const cloudinaryConfig: CloudinaryConfig = { - cloudName: Env.get('CLOUDINARY_CLOUD_NAME'), - apiKey: Env.get('CLOUDINARY_API_KEY'), - apiSecret: Env.get('CLOUDINARY_API_SECRET'), - secure: Env.get('CLOUDINARY_SECURE', true), -}; - -export default cloudinaryConfig;