This commit is contained in:
Hugo Falcao
2022-04-17 20:50:42 -03:00
parent 24c072f750
commit c4917d248f
11 changed files with 4 additions and 715 deletions

View File

@@ -28,7 +28,6 @@ class UpdateUserService {
};
user.name = name;
user.username = username;
user.bio = bio;
user.birth_date = new Date(birth_date); // TODO, funciona?

View File

@@ -8,14 +8,12 @@ import Social from '../models/Social';
interface Request {
id_user: string;
social_network: string;
username: string;
}
class UpdateUserSocialService {
public async execute({
id_user,
social_network,
username,
}: Request): Promise<Social> {
const usersRepository = getRepository(User);
const socialRepository = getRepository(Social);
@@ -36,16 +34,16 @@ class UpdateUserSocialService {
switch (social_network) {
case 'telegram':
social.telegram = username;
social.telegram = "";
break;
case 'facebook':
social.facebook = username;
social.facebook = "";
break;
case 'twitter':
social.twitter = username;
social.twitter = "";
break;
case 'twitch':
social.twitch = username;
social.twitch = "";
break;
default: