@@ -4,7 +4,6 @@ import { IModule, IModuleUpdateBody, Module, PlatformNames, ModuleNames } from '
44
55import platformService from './platform.service' ;
66import websiteService from './website' ;
7- import mediawikiService from './mediawiki' ;
87
98/**
109 * Create a module
@@ -92,13 +91,9 @@ const updateModule = async (
9291 const existingPlatform = module . options . platforms . find ( ( p ) => p . name === newPlatform . name ) ;
9392
9493 if ( existingPlatform ) {
95- if ( module . name === ModuleNames . Hivemind ) {
96- if ( newPlatform . name === PlatformNames . Website ) {
97- await handleHivemindWebsiteCase ( newPlatform ) ;
98- } else if ( newPlatform . name === PlatformNames . MediaWiki ) {
99- await handleHivemindMediaWikiCase ( newPlatform ) ;
100- }
101- }
94+ // if (module.name === ModuleNames.Hivemind && newPlatform.name === PlatformNames.Website) {
95+ // await handleHivemindWebsiteCase(newPlatform);
96+ // }
10297 existingPlatform . metadata = newPlatform . metadata ;
10398 } else {
10499 module . options . platforms . push ( newPlatform ) ;
@@ -137,32 +132,6 @@ const handleHivemindWebsiteCase = async (platform: any) => {
137132 }
138133} ;
139134
140- const handleHivemindMediaWikiCase = async ( platform : any ) => {
141- const platformDoc = await platformService . getPlatformById ( platform . platform ) ;
142-
143- if ( ! platformDoc ) return ;
144-
145- const isActivated = platform . metadata ?. activated ;
146- const existingScheduleId = platformDoc . get ( 'metadata.scheduleId' ) ;
147-
148- if ( isActivated === true ) {
149- if ( ! existingScheduleId ) {
150- const scheduleId = await mediawikiService . coreService . createMediaWikiSchedule ( platform . platform ) ;
151- platformDoc . set ( 'metadata.scheduleId' , scheduleId ) ;
152-
153- await platformDoc . save ( ) ;
154- }
155- } else if ( isActivated === false ) {
156- if ( existingScheduleId ) {
157- await mediawikiService . coreService . deleteMediaWikiSchedule ( existingScheduleId ) ;
158- await mediawikiService . coreService . terminateMediaWikiWorkflow ( platformDoc . community . toString ( ) ) ;
159- platformDoc . set ( 'metadata.scheduleId' , null ) ;
160-
161- await platformDoc . save ( ) ;
162- }
163- }
164- } ;
165-
166135/**
167136 * Delete module
168137 * @param {HydratedDocument<IModule> } module - module doc
0 commit comments