mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
refactor: upd contact
This commit is contained in:
parent
42b60cb9fa
commit
697c0bdb9b
@ -64,8 +64,8 @@ export default class ContactRepository {
|
|||||||
|
|
||||||
if (contacts) {
|
if (contacts) {
|
||||||
contacts.phone_number = data.phone_number ?? null;
|
contacts.phone_number = data.phone_number ?? null;
|
||||||
contacts.telegram_id = data.telegram_id ?? null;
|
contacts.telegram_id = data.telegram_id?.substring(1) ?? null;
|
||||||
contacts.twitter_id = data.twitter_id ?? null;
|
contacts.twitter_id = data.twitter_id?.substring(1) ?? null;
|
||||||
contacts.vk_id = data.vk_id ?? null;
|
contacts.vk_id = data.vk_id ?? null;
|
||||||
|
|
||||||
await contacts.save();
|
await contacts.save();
|
||||||
|
|||||||
@ -11,9 +11,9 @@ export default class UpdateContactsValidator {
|
|||||||
strict: true,
|
strict: true,
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
vk_id: schema.string.optional({}, [rules.regex(/^[a-zA-Z0-9_]+$/)]),
|
vk_id: schema.string.optional({}, [rules.regex(/^([a-zA-Z0-9_]){1,64}$/)]),
|
||||||
twitter_id: schema.string.optional({}, [rules.regex(/^[a-zA-Z0-9_]+$/)]),
|
twitter_id: schema.string.optional({}, [rules.regex(/(^|[^@\w])@(\w{1,15})\b/)]),
|
||||||
telegram_id: schema.string.optional({}, [rules.regex(/^[a-zA-Z0-9_]+$/)]),
|
telegram_id: schema.string.optional({}, [rules.regex(/(^|[^@\w])@(\w{1,64})\b/)]),
|
||||||
});
|
});
|
||||||
|
|
||||||
public messages = {};
|
public messages = {};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user