diff --git a/src/logic/course.ts b/src/logic/course.ts index b9c559f..045235c 100644 --- a/src/logic/course.ts +++ b/src/logic/course.ts @@ -5,6 +5,7 @@ import {GPAUtils} from '@/logic/utils/gpa-utils'; import CacheUtils from '@/logic/utils/cache-utils'; import Constants from '@/constants'; import {Index} from '@/logic/nav-controller'; +import App from '@/components/app/app'; /** * Objects of this interface represent assignment grades. @@ -60,6 +61,27 @@ export class Assignment { return this.complete == 'Complete'; } + + /** + * Mark as read + */ + markAsRead(): Promise + { + return new Promise((resolve, reject) => { + App.http.post('/mark-as-read', {scoreId: this.scoreId}) + .then(response => + { + // Check success + if (response.success) + { + this.unread = false; + resolve(); + } + else reject(response.data); + }) + .catch(reject) + }) + } } export interface AssignmentType