remove google account details on unlink
parent
fb47d7d0bd
commit
64e4037b39
|
@ -420,6 +420,20 @@ export async function UnlinkGoogleCalendar(req: Request, res: Response) {
|
|||
userId: userSession.user_id,
|
||||
});
|
||||
|
||||
// set user google account data to null
|
||||
|
||||
await User.update(
|
||||
{
|
||||
google_account_name: "",
|
||||
google_account_picture: "",
|
||||
},
|
||||
{
|
||||
where: {
|
||||
user_id: userSession.user_id,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
res.status(200).send({ msg: "success" });
|
||||
} catch (error) {
|
||||
logger.error(error);
|
||||
|
|
|
@ -93,7 +93,7 @@ User.init(
|
|||
},
|
||||
google_account_picture: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
allowNull: true, // varchar(1050) needs to be set manually
|
||||
},
|
||||
analytics_enabled: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
|
|
Loading…
Reference in New Issue