-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add sync existing course * N21-2075 modify course metadata * update course entity mapping * update courses /all endpoint * update get course infos * update course DO * N21-2075 permission check * update course synchronization * add migration * update course find all * update seed data roles * update pagination handling for courses * update course do service * update classes repo spec * N21-2075 Calendar flag for Nuxt * update courses info response * migration: Migration20240823151836 * add course info controller * update sourse info + course repo * update classe service tests --------- Co-authored-by: Mrika Llabani <[email protected]> Co-authored-by: mrikallab <[email protected]>
- Loading branch information
1 parent
68a1747
commit 21a5f8e
Showing
58 changed files
with
1,843 additions
and
77 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
apps/server/src/migrations/mikro-orm/Migration20240823151836.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Migration } from '@mikro-orm/migrations-mongodb'; | ||
|
||
export class Migration20240823151836 extends Migration { | ||
async up(): Promise<void> { | ||
const adminRoleUpdate = await this.getCollection('roles').updateOne( | ||
{ name: 'administrator' }, | ||
{ | ||
$addToSet: { | ||
permissions: { | ||
$each: ['COURSE_ADMINISTRATION'], | ||
}, | ||
}, | ||
} | ||
); | ||
|
||
if (adminRoleUpdate.modifiedCount > 0) { | ||
console.info('Permission COURSE_ADMINISTRATION added to role administrator.'); | ||
} | ||
} | ||
|
||
async down(): Promise<void> { | ||
const adminRoleUpdate = await this.getCollection('roles').updateOne( | ||
{ name: 'administrator' }, | ||
{ | ||
$pull: { | ||
permissions: { | ||
$in: ['COURSE_ADMINISTRATION'], | ||
}, | ||
}, | ||
} | ||
); | ||
|
||
if (adminRoleUpdate.modifiedCount > 0) { | ||
console.info('Rollback: Permission COURSE_ADMINISTRATION added to role administrator.'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.