From 5d39d8efc9a4f6778103e0d00663e618122a2056 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 1 Mar 2021 15:38:08 +0100 Subject: [PATCH] MOBILE-3643 forum: Rename services --- .../discussion-options-menu.ts | 2 +- .../forum/components/edit-post/edit-post.ts | 4 +-- .../mod/forum/components/index/index.ts | 8 ++--- .../post-options-menu/post-options-menu.ts | 2 +- src/addons/mod/forum/components/post/post.ts | 8 ++--- .../sort-order-selector.ts | 2 +- src/addons/mod/forum/forum.module.ts | 2 +- .../forum/pages/discussion/discussion.page.ts | 8 ++--- src/addons/mod/forum/pages/index/index.ts | 2 +- .../new-discussion/new-discussion.page.ts | 8 ++--- .../{offline-db.ts => database/offline.ts} | 9 ++++++ .../services/{forum.service.ts => forum.ts} | 24 +++++++------- .../mod/forum/services/handlers/module.ts | 4 +-- .../mod/forum/services/handlers/prefetch.ts | 4 +-- .../mod/forum/services/handlers/push-click.ts | 2 +- .../mod/forum/services/handlers/sync-cron.ts | 2 +- .../services/{helper.service.ts => helper.ts} | 4 +-- .../{offline.service.ts => offline.ts} | 32 +++++++++---------- .../services/{sync.service.ts => sync.ts} | 6 ++-- .../features/sitehome/services/sitehome.ts | 2 +- 20 files changed, 71 insertions(+), 64 deletions(-) rename src/addons/mod/forum/services/{offline-db.ts => database/offline.ts} (90%) rename src/addons/mod/forum/services/{forum.service.ts => forum.ts} (99%) rename src/addons/mod/forum/services/{helper.service.ts => helper.ts} (99%) rename src/addons/mod/forum/services/{offline.service.ts => offline.ts} (95%) rename src/addons/mod/forum/services/{sync.service.ts => sync.ts} (99%) diff --git a/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts b/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts index 5eeffaa5b..10969ab5d 100644 --- a/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts +++ b/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts @@ -17,7 +17,7 @@ import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { PopoverController } from '@singletons'; import { CoreEvents } from '@singletons/events'; -import { AddonModForum, AddonModForumDiscussion, AddonModForumProvider } from '../../services/forum.service'; +import { AddonModForum, AddonModForumDiscussion, AddonModForumProvider } from '../../services/forum'; /** * This component is meant to display a popover with the discussion options. diff --git a/src/addons/mod/forum/components/edit-post/edit-post.ts b/src/addons/mod/forum/components/edit-post/edit-post.ts index 2704ffa95..a0e340629 100644 --- a/src/addons/mod/forum/components/edit-post/edit-post.ts +++ b/src/addons/mod/forum/components/edit-post/edit-post.ts @@ -18,8 +18,8 @@ import { CoreFileEntry, CoreFileUploader } from '@features/fileuploader/services import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { ModalController, Translate } from '@singletons'; -import { AddonModForumData, AddonModForumPost, AddonModForumReply } from '@addons/mod/forum/services/forum.service'; -import { AddonModForumHelper } from '@addons/mod/forum/services/helper.service'; +import { AddonModForumData, AddonModForumPost, AddonModForumReply } from '@addons/mod/forum/services/forum'; +import { AddonModForumHelper } from '@addons/mod/forum/services/helper'; /** * Page that displays a form to edit discussion post. diff --git a/src/addons/mod/forum/components/index/index.ts b/src/addons/mod/forum/components/index/index.ts index ed8018df9..cd9f4301e 100644 --- a/src/addons/mod/forum/components/index/index.ts +++ b/src/addons/mod/forum/components/index/index.ts @@ -24,11 +24,11 @@ import { AddonModForumDiscussion, AddonModForumNewDiscussionData, AddonModForumReplyDiscussionData, -} from '@addons/mod/forum/services/forum.service'; -import { AddonModForumOffline, AddonModForumOfflineDiscussion } from '@addons/mod/forum/services/offline.service'; +} from '@addons/mod/forum/services/forum'; +import { AddonModForumOffline, AddonModForumOfflineDiscussion } from '@addons/mod/forum/services/offline'; import { ModalController, PopoverController, Translate } from '@singletons'; import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; -import { AddonModForumHelper } from '@addons/mod/forum/services/helper.service'; +import { AddonModForumHelper } from '@addons/mod/forum/services/helper'; import { CoreGroups, CoreGroupsProvider } from '@services/groups'; import { CoreEvents, CoreEventObserver } from '@singletons/events'; import { @@ -36,7 +36,7 @@ import { AddonModForumManualSyncData, AddonModForumSyncProvider, AddonModForumSyncResult, -} from '@addons/mod/forum/services/sync.service'; +} from '@addons/mod/forum/services/sync'; import { CoreSites } from '@services/sites'; import { CoreUser } from '@features/user/services/user'; import { CoreDomUtils } from '@services/utils/dom'; diff --git a/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts b/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts index ed5bf452f..74443bcf8 100644 --- a/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts +++ b/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts @@ -15,7 +15,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; import { CoreApp } from '@services/app'; -import { AddonModForum, AddonModForumPost } from '@addons/mod/forum/services/forum.service'; +import { AddonModForum, AddonModForumPost } from '@addons/mod/forum/services/forum'; import { Network, NgZone, PopoverController } from '@singletons'; import { Subscription } from 'rxjs'; import { CoreDomUtils } from '@services/utils/dom'; diff --git a/src/addons/mod/forum/components/post/post.ts b/src/addons/mod/forum/components/post/post.ts index f41115ace..9fd345a13 100644 --- a/src/addons/mod/forum/components/post/post.ts +++ b/src/addons/mod/forum/components/post/post.ts @@ -39,16 +39,16 @@ import { AddonModForumReply, AddonModForumUpdateDiscussionPostWSOptionsObject, AddonModForumWSPostAttachment, -} from '../../services/forum.service'; +} from '../../services/forum'; import { CoreTag } from '@features/tag/services/tag'; import { ModalController, PopoverController, Translate } from '@singletons'; import { CoreFileEntry, CoreFileUploader } from '@features/fileuploader/services/fileuploader'; import { IonContent } from '@ionic/angular'; -import { AddonModForumSync } from '../../services/sync.service'; +import { AddonModForumSync } from '../../services/sync'; import { CoreSync } from '@services/sync'; import { CoreTextUtils } from '@services/utils/text'; -import { AddonModForumHelper } from '../../services/helper.service'; -import { AddonModForumOffline, AddonModForumReplyOptions } from '../../services/offline.service'; +import { AddonModForumHelper } from '../../services/helper'; +import { AddonModForumOffline, AddonModForumReplyOptions } from '../../services/offline'; import { CoreUtils } from '@services/utils/utils'; import { AddonModForumPostOptionsMenuComponent } from '../post-options-menu/post-options-menu'; import { AddonModForumEditPostComponent } from '../edit-post/edit-post'; diff --git a/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.ts b/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.ts index 8c3669bee..6240be65b 100644 --- a/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.ts +++ b/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, Input } from '@angular/core'; -import { AddonModForumSortOrder } from '@addons/mod/forum/services/forum.service'; +import { AddonModForumSortOrder } from '@addons/mod/forum/services/forum'; import { ModalController } from '@singletons'; /** diff --git a/src/addons/mod/forum/forum.module.ts b/src/addons/mod/forum/forum.module.ts index 283057df3..d829982ba 100644 --- a/src/addons/mod/forum/forum.module.ts +++ b/src/addons/mod/forum/forum.module.ts @@ -24,7 +24,7 @@ import { CoreScreen } from '@services/screen'; import { AddonModForumComponentsModule } from './components/components.module'; import { AddonModForumModuleHandler, AddonModForumModuleHandlerService } from './services/handlers/module'; -import { SITE_SCHEMA } from './services/offline-db'; +import { SITE_SCHEMA } from './services/database/offline'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { AddonModForumPrefetchHandler } from './services/handlers/prefetch'; import { CoreCronDelegate } from '@services/cron'; diff --git a/src/addons/mod/forum/pages/discussion/discussion.page.ts b/src/addons/mod/forum/pages/discussion/discussion.page.ts index 5f8bc2d1d..23f29d6e7 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.page.ts +++ b/src/addons/mod/forum/pages/discussion/discussion.page.ts @@ -34,10 +34,10 @@ import { AddonModForumPost, AddonModForumProvider, AddonModForumRatingInfo, -} from '../../services/forum.service'; -import { AddonModForumHelper } from '../../services/helper.service'; -import { AddonModForumOffline } from '../../services/offline.service'; -import { AddonModForumSync, AddonModForumSyncProvider } from '../../services/sync.service'; +} from '../../services/forum'; +import { AddonModForumHelper } from '../../services/helper'; +import { AddonModForumOffline } from '../../services/offline'; +import { AddonModForumSync, AddonModForumSyncProvider } from '../../services/sync'; type SortType = 'flat-newest' | 'flat-oldest' | 'nested'; diff --git a/src/addons/mod/forum/pages/index/index.ts b/src/addons/mod/forum/pages/index/index.ts index fb1237a53..d4c0737e8 100644 --- a/src/addons/mod/forum/pages/index/index.ts +++ b/src/addons/mod/forum/pages/index/index.ts @@ -14,7 +14,7 @@ import { Component, OnInit } from '@angular/core'; -import { AddonModForumData } from '@addons/mod/forum/services/forum.service'; +import { AddonModForumData } from '@addons/mod/forum/services/forum'; import { CoreCourseAnyModuleData } from '@features/course/services/course'; import { CoreNavigator } from '@services/navigator'; diff --git a/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts b/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts index 17a956650..35708874e 100644 --- a/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts +++ b/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts @@ -24,16 +24,16 @@ import { AddonModForumCanAddDiscussion, AddonModForumData, AddonModForumProvider, -} from '@addons/mod/forum/services/forum.service'; +} from '@addons/mod/forum/services/forum'; import { CoreEditorRichTextEditorComponent } from '@features/editor/components/rich-text-editor/rich-text-editor'; -import { AddonModForumSync, AddonModForumSyncProvider } from '@addons/mod/forum/services/sync.service'; +import { AddonModForumSync, AddonModForumSyncProvider } from '@addons/mod/forum/services/sync'; import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { Translate } from '@singletons'; import { CoreSync } from '@services/sync'; -import { AddonModForumDiscussionOptions, AddonModForumOffline } from '@addons/mod/forum/services/offline.service'; +import { AddonModForumDiscussionOptions, AddonModForumOffline } from '@addons/mod/forum/services/offline'; import { CoreUtils } from '@services/utils/utils'; -import { AddonModForumHelper } from '@addons/mod/forum/services/helper.service'; +import { AddonModForumHelper } from '@addons/mod/forum/services/helper'; import { IonRefresher } from '@ionic/angular'; import { CoreFileUploader } from '@features/fileuploader/services/fileuploader'; import { CoreTextUtils } from '@services/utils/text'; diff --git a/src/addons/mod/forum/services/offline-db.ts b/src/addons/mod/forum/services/database/offline.ts similarity index 90% rename from src/addons/mod/forum/services/offline-db.ts rename to src/addons/mod/forum/services/database/offline.ts index d690c1956..ce28a9776 100644 --- a/src/addons/mod/forum/services/offline-db.ts +++ b/src/addons/mod/forum/services/database/offline.ts @@ -13,6 +13,7 @@ // limitations under the License. import { CoreSiteSchema } from '@services/sites'; +import { AddonModForumOfflineDiscussion, AddonModForumOfflineReply } from '../offline'; /** * Database variables for AddonModForum service. @@ -113,3 +114,11 @@ export const SITE_SCHEMA: CoreSiteSchema = { }, ], }; + +export type AddonModForumOfflineDiscussionDBRecord = Omit & { + options: string; +}; + +export type AddonModForumOfflineReplyDBRecord = Omit & { + options: string; +}; diff --git a/src/addons/mod/forum/services/forum.service.ts b/src/addons/mod/forum/services/forum.ts similarity index 99% rename from src/addons/mod/forum/services/forum.service.ts rename to src/addons/mod/forum/services/forum.ts index 844afb822..d3eabeaaf 100644 --- a/src/addons/mod/forum/services/forum.service.ts +++ b/src/addons/mod/forum/services/forum.ts @@ -26,7 +26,7 @@ import { CoreUrlUtils } from '@services/utils/url'; import { CoreUtils } from '@services/utils/utils'; import { CoreStatusWithWarningsWSResponse, CoreWSExternalFile, CoreWSExternalWarning } from '@services/ws'; import { makeSingleton, Translate } from '@singletons'; -import { AddonModForumOffline, AddonModForumOfflineDiscussion, AddonModForumReplyOptions } from './offline.service'; +import { AddonModForumOffline, AddonModForumOfflineDiscussion, AddonModForumReplyOptions } from './offline'; const ROOT_CACHE_KEY = 'mmaModForum:'; @@ -216,11 +216,7 @@ export class AddonModForumProvider { const response = await site.write('mod_forum_add_discussion', params); // Other errors ocurring. - if (!response || !response.discussionid) { - return Promise.reject(CoreUtils.instance.createFakeWSError('')); - } else { - return response.discussionid; - } + return response.discussionid; } /** @@ -832,7 +828,7 @@ export class AddonModForumProvider { let numPages = typeof options.numPages == 'undefined' ? -1 : options.numPages; if (!numPages) { - return Promise.resolve(result); + return result; } const getPage = (page: number): Promise<{ discussions: AddonModForumDiscussion[]; error: boolean }> => @@ -1114,7 +1110,7 @@ export class AddonModForumProvider { return storeOffline(); } else { // The WebService has thrown an error or offline not supported, reject. - return Promise.reject(error); + throw error; } } } @@ -1142,8 +1138,10 @@ export class AddonModForumProvider { subject: subject, message: message, - // eslint-disable-next-line max-len - options: CoreUtils.instance.objectToArrayOfObjects( + options: CoreUtils.instance.objectToArrayOfObjects< + AddonModForumAddDiscussionPostWSOptionsArray[0], + AddonModForumAddDiscussionPostWSOptionsObject + >( options || {}, 'name', 'value', @@ -1297,8 +1295,10 @@ export class AddonModForumProvider { subject: subject, message: message, - // eslint-disable-next-line max-len - options: CoreUtils.instance.objectToArrayOfObjects( + options: CoreUtils.instance.objectToArrayOfObjects< + AddonModForumUpdateDiscussionPostWSOptionsArray[0], + AddonModForumUpdateDiscussionPostWSOptionsObject + >( options || {}, 'name', 'value', diff --git a/src/addons/mod/forum/services/handlers/module.ts b/src/addons/mod/forum/services/handlers/module.ts index cccd98a82..8df24e921 100644 --- a/src/addons/mod/forum/services/handlers/module.ts +++ b/src/addons/mod/forum/services/handlers/module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable, Type } from '@angular/core'; -import { AddonModForum, AddonModForumProvider } from '../forum.service'; +import { AddonModForum, AddonModForumProvider } from '../forum'; import { CoreCourse, CoreCourseAnyModuleData } from '@features/course/services/course'; import { CoreCourseModule } from '@features/course/services/course-helper'; import { CoreNavigationOptions, CoreNavigator } from '@services/navigator'; @@ -73,7 +73,7 @@ export class AddonModForumModuleHandlerService implements CoreCourseModuleHandle title: module.name, class: 'addon-mod_forum-handler', showDownloadButton: true, - action(_: Event, module: CoreCourseModule, courseId: number, options?: CoreNavigationOptions): void { + action(event: Event, module: CoreCourseModule, courseId: number, options?: CoreNavigationOptions): void { options = options || {}; options.params = options.params || {}; Object.assign(options.params, { module }); diff --git a/src/addons/mod/forum/services/handlers/prefetch.ts b/src/addons/mod/forum/services/handlers/prefetch.ts index 501d21090..858856133 100644 --- a/src/addons/mod/forum/services/handlers/prefetch.ts +++ b/src/addons/mod/forum/services/handlers/prefetch.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreCourseActivityPrefetchHandlerBase } from '@features/course/classes/activity-prefetch-handler'; -import { AddonModForum, AddonModForumData, AddonModForumPost, AddonModForumProvider } from '../forum.service'; +import { AddonModForum, AddonModForumData, AddonModForumPost, AddonModForumProvider } from '../forum'; import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; import { CoreFilepool } from '@services/filepool'; import { CoreWSExternalFile } from '@services/ws'; @@ -22,7 +22,7 @@ import { CoreCourse, CoreCourseAnyModuleData, CoreCourseCommonModWSOptions } fro import { CoreUser } from '@features/user/services/user'; import { CoreGroups, CoreGroupsProvider } from '@services/groups'; import { CoreUtils } from '@services/utils/utils'; -import { AddonModForumSync } from '../sync.service'; +import { AddonModForumSync } from '../sync'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/mod/forum/services/handlers/push-click.ts b/src/addons/mod/forum/services/handlers/push-click.ts index dc898d75b..05e3f1dfc 100644 --- a/src/addons/mod/forum/services/handlers/push-click.ts +++ b/src/addons/mod/forum/services/handlers/push-click.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { Params } from '@angular/router'; -import { AddonModForum } from '@addons/mod/forum/services/forum.service'; +import { AddonModForum } from '@addons/mod/forum/services/forum'; import { CoreNavigator } from '@services/navigator'; import { CorePushNotificationsClickHandler } from '@features/pushnotifications/services/push-delegate'; import { CorePushNotificationsNotificationBasicData } from '@features/pushnotifications/services/pushnotifications'; diff --git a/src/addons/mod/forum/services/handlers/sync-cron.ts b/src/addons/mod/forum/services/handlers/sync-cron.ts index 07cfdfd46..86f6aff10 100644 --- a/src/addons/mod/forum/services/handlers/sync-cron.ts +++ b/src/addons/mod/forum/services/handlers/sync-cron.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreCronHandler } from '@services/cron'; import { makeSingleton } from '@singletons'; -import { AddonModForumSync } from '../sync.service'; +import { AddonModForumSync } from '../sync'; /** * Synchronization cron handler. diff --git a/src/addons/mod/forum/services/helper.service.ts b/src/addons/mod/forum/services/helper.ts similarity index 99% rename from src/addons/mod/forum/services/helper.service.ts rename to src/addons/mod/forum/services/helper.ts index f8b5114a2..25266f75b 100644 --- a/src/addons/mod/forum/services/helper.service.ts +++ b/src/addons/mod/forum/services/helper.ts @@ -29,8 +29,8 @@ import { AddonModForumDiscussion, AddonModForumPost, AddonModForumProvider, -} from './forum.service'; -import { AddonModForumDiscussionOptions, AddonModForumOffline, AddonModForumOfflineReply } from './offline.service'; +} from './forum'; +import { AddonModForumDiscussionOptions, AddonModForumOffline, AddonModForumOfflineReply } from './offline'; /** * Service that provides some features for forums. diff --git a/src/addons/mod/forum/services/offline.service.ts b/src/addons/mod/forum/services/offline.ts similarity index 95% rename from src/addons/mod/forum/services/offline.service.ts rename to src/addons/mod/forum/services/offline.ts index 2dbc0b0d5..8ece6b1b2 100644 --- a/src/addons/mod/forum/services/offline.service.ts +++ b/src/addons/mod/forum/services/offline.ts @@ -18,8 +18,13 @@ import { CoreFile } from '@services/file'; import { CoreSites } from '@services/sites'; import { CoreTextUtils } from '@services/utils/text'; import { makeSingleton } from '@singletons'; -import { AddonModForumProvider } from './forum.service'; -import { DISCUSSIONS_TABLE, REPLIES_TABLE } from './offline-db'; +import { AddonModForumProvider } from './forum'; +import { + AddonModForumOfflineDiscussionDBRecord, + AddonModForumOfflineReplyDBRecord, + DISCUSSIONS_TABLE, + REPLIES_TABLE, +} from './database/offline'; /** * Service to handle offline forum. @@ -69,7 +74,7 @@ export class AddonModForumOfflineProvider { timecreated: timeCreated, }; - const record = await site.getDb().getRecord(DISCUSSIONS_TABLE, conditions); + const record = await site.getDb().getRecord(DISCUSSIONS_TABLE, conditions); return this.parseRecordOptions(record); } @@ -82,7 +87,7 @@ export class AddonModForumOfflineProvider { */ async getAllNewDiscussions(siteId?: string): Promise { const site = await CoreSites.instance.getSite(siteId); - const records = await site.getDb().getRecords(DISCUSSIONS_TABLE); + const records = await site.getDb().getRecords(DISCUSSIONS_TABLE); return this.parseRecordsOptions(records); } @@ -122,7 +127,7 @@ export class AddonModForumOfflineProvider { userid: userId || site.getUserId(), }; - const records = await site.getDb().getRecords(DISCUSSIONS_TABLE, conditions); + const records = await site.getDb().getRecords(DISCUSSIONS_TABLE, conditions); return this.parseRecordsOptions(records); } @@ -155,7 +160,7 @@ export class AddonModForumOfflineProvider { userId?: number, ): Promise { const site = await CoreSites.instance.getSite(siteId); - const data: AddonModForumOfflineDiscussionRecord = { + const data: AddonModForumOfflineDiscussionDBRecord = { forumid: forumId, name: name, courseid: courseId, @@ -196,7 +201,7 @@ export class AddonModForumOfflineProvider { */ async getAllReplies(siteId?: string): Promise { const site = await CoreSites.instance.getSite(siteId); - const records = await site.getDb().getRecords(REPLIES_TABLE); + const records = await site.getDb().getRecords(REPLIES_TABLE); return this.parseRecordsOptions(records); } @@ -236,7 +241,7 @@ export class AddonModForumOfflineProvider { userid: userId || site.getUserId(), }; - const records = await site.getDb().getRecords(REPLIES_TABLE, conditions); + const records = await site.getDb().getRecords(REPLIES_TABLE, conditions); return this.parseRecordsOptions(records); } @@ -276,7 +281,7 @@ export class AddonModForumOfflineProvider { userid: userId || site.getUserId(), }; - const records = await site.getDb().getRecords(REPLIES_TABLE, conditions); + const records = await site.getDb().getRecords(REPLIES_TABLE, conditions); return this.parseRecordsOptions(records); } @@ -309,7 +314,7 @@ export class AddonModForumOfflineProvider { userId?: number, ): Promise { const site = await CoreSites.instance.getSite(siteId); - const data: AddonModForumOfflineReplyRecord = { + const data: AddonModForumOfflineReplyDBRecord = { postid: postId, discussionid: discussionId, forumid: forumId, @@ -437,10 +442,3 @@ export type AddonModForumOfflineReply = { userid: number; timecreated: number; }; - -export type AddonModForumOfflineDiscussionRecord = Omit & { - options: string; -}; -export type AddonModForumOfflineReplyRecord = Omit & { - options: string; -}; diff --git a/src/addons/mod/forum/services/sync.service.ts b/src/addons/mod/forum/services/sync.ts similarity index 99% rename from src/addons/mod/forum/services/sync.service.ts rename to src/addons/mod/forum/services/sync.ts index 100b29fc3..1f99f2ec2 100644 --- a/src/addons/mod/forum/services/sync.service.ts +++ b/src/addons/mod/forum/services/sync.ts @@ -31,9 +31,9 @@ import { AddonModForumAddDiscussionPostWSOptionsObject, AddonModForumAddDiscussionWSOptionsObject, AddonModForumProvider, -} from './forum.service'; -import { AddonModForumHelper } from './helper.service'; -import { AddonModForumOffline, AddonModForumOfflineDiscussion, AddonModForumOfflineReply } from './offline.service'; +} from './forum'; +import { AddonModForumHelper } from './helper'; +import { AddonModForumOffline, AddonModForumOfflineDiscussion, AddonModForumOfflineReply } from './offline'; declare module '@singletons/events' { diff --git a/src/core/features/sitehome/services/sitehome.ts b/src/core/features/sitehome/services/sitehome.ts index 3694b3d40..85c75ba51 100644 --- a/src/core/features/sitehome/services/sitehome.ts +++ b/src/core/features/sitehome/services/sitehome.ts @@ -19,7 +19,7 @@ import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; import { makeSingleton } from '@singletons'; import { CoreCourse } from '../../course/services/course'; import { CoreCourses } from '../../courses/services/courses'; -import { AddonModForum, AddonModForumData } from '@addons/mod/forum/services/forum.service'; +import { AddonModForum, AddonModForumData } from '@addons/mod/forum/services/forum'; /** * Items with index 1 and 3 were removed on 2.5 and not being supported in the app.