Skip to content

Commit

Permalink
More styling aghh
Browse files Browse the repository at this point in the history
  • Loading branch information
Ammar-T committed Apr 28, 2023
1 parent 28b0fa3 commit 1017515
Showing 1 changed file with 28 additions and 36 deletions.
64 changes: 28 additions & 36 deletions backend/migrations/20230117192943-set-post-colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,39 @@ export const up = async (db: Db, client: MongoClient) => {

if (user.role == Role.STUDENT) {
if (!post.displayAttributes) {
await db
.collection<PostModel>('posts')
.updateOne(
{ postID: post.postID },
{
$set: {
displayAttributes: { fillColor: STUDENT_POST_COLOR },
},
}
);
await db.collection<PostModel>('posts').updateOne(
{ postID: post.postID },
{
$set: {
displayAttributes: { fillColor: STUDENT_POST_COLOR },
},
}
);
} else {
await db
.collection<PostModel>('posts')
.updateOne(
{ postID: post.postID },
{
$set: { 'displayAttributes.fillColor': STUDENT_POST_COLOR },
}
);
await db.collection<PostModel>('posts').updateOne(
{ postID: post.postID },
{
$set: { 'displayAttributes.fillColor': STUDENT_POST_COLOR },
}
);
}
} else {
if (!post.displayAttributes) {
await db
.collection<PostModel>('posts')
.updateOne(
{ postID: post.postID },
{
$set: {
displayAttributes: { fillColor: TEACHER_POST_COLOR },
},
}
);
await db.collection<PostModel>('posts').updateOne(
{ postID: post.postID },
{
$set: {
displayAttributes: { fillColor: TEACHER_POST_COLOR },
},
}
);
} else {
await db
.collection<PostModel>('posts')
.updateOne(
{ postID: post.postID },
{
$set: { 'displayAttributes.fillColor': TEACHER_POST_COLOR },
}
);
await db.collection<PostModel>('posts').updateOne(
{ postID: post.postID },
{
$set: { 'displayAttributes.fillColor': TEACHER_POST_COLOR },
}
);
}
}
}
Expand Down

0 comments on commit 1017515

Please sign in to comment.