From 1017515f30b8085a45f9fc7383c790859bdbc1d8 Mon Sep 17 00:00:00 2001 From: Ammar Date: Fri, 28 Apr 2023 11:46:34 -0400 Subject: [PATCH] More styling aghh --- .../20230117192943-set-post-colors.ts | 64 ++++++++----------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/backend/migrations/20230117192943-set-post-colors.ts b/backend/migrations/20230117192943-set-post-colors.ts index fa3ce610..8627d6b4 100644 --- a/backend/migrations/20230117192943-set-post-colors.ts +++ b/backend/migrations/20230117192943-set-post-colors.ts @@ -25,47 +25,39 @@ export const up = async (db: Db, client: MongoClient) => { if (user.role == Role.STUDENT) { if (!post.displayAttributes) { - await db - .collection('posts') - .updateOne( - { postID: post.postID }, - { - $set: { - displayAttributes: { fillColor: STUDENT_POST_COLOR }, - }, - } - ); + await db.collection('posts').updateOne( + { postID: post.postID }, + { + $set: { + displayAttributes: { fillColor: STUDENT_POST_COLOR }, + }, + } + ); } else { - await db - .collection('posts') - .updateOne( - { postID: post.postID }, - { - $set: { 'displayAttributes.fillColor': STUDENT_POST_COLOR }, - } - ); + await db.collection('posts').updateOne( + { postID: post.postID }, + { + $set: { 'displayAttributes.fillColor': STUDENT_POST_COLOR }, + } + ); } } else { if (!post.displayAttributes) { - await db - .collection('posts') - .updateOne( - { postID: post.postID }, - { - $set: { - displayAttributes: { fillColor: TEACHER_POST_COLOR }, - }, - } - ); + await db.collection('posts').updateOne( + { postID: post.postID }, + { + $set: { + displayAttributes: { fillColor: TEACHER_POST_COLOR }, + }, + } + ); } else { - await db - .collection('posts') - .updateOne( - { postID: post.postID }, - { - $set: { 'displayAttributes.fillColor': TEACHER_POST_COLOR }, - } - ); + await db.collection('posts').updateOne( + { postID: post.postID }, + { + $set: { 'displayAttributes.fillColor': TEACHER_POST_COLOR }, + } + ); } } }