File

src/app/modules/discussion/services/discussion/discussion.service.ts

Index

Properties
Methods

Constructor

constructor(csLibInitializerService: CsLibInitializerService, formService: FormService)
Parameters :
Name Type Optional
csLibInitializerService CsLibInitializerService No
formService FormService No

Methods

attachForum
attachForum(data)
Parameters :
Name Optional
data No
Returns : any
createForum
createForum(data)
Parameters :
Name Optional
data No
Returns : any
fetchForumConfig
fetchForumConfig(contentType)
Parameters :
Name Optional
contentType No
Returns : any
getForumIds
getForumIds(data)
Parameters :
Name Optional
data No
Returns : any
getUserDetails
getUserDetails(userId)
Parameters :
Name Optional
userId No
Returns : any
registerUser
registerUser(data)
Parameters :
Name Optional
data No
Returns : any
removeForum
removeForum(data)
Parameters :
Name Optional
data No
Returns : any

Properties

discussionCsService
Type : any
import { CsLibInitializerService } from './../../../../service/CsLibInitializer/cs-lib-initializer.service';
import { Injectable } from '@angular/core';
import { CsModule } from '@project-sunbird/client-services';
import { FormService } from '@sunbird/core';

@Injectable({
  providedIn: 'root'
})
export class DiscussionService {

  discussionCsService: any;

  constructor(
    private csLibInitializerService: CsLibInitializerService,
    private formService: FormService
  ) {
    if (!CsModule.instance.isInitialised) {
      this.csLibInitializerService.initializeCs();
    }
    this.discussionCsService = CsModule.instance.discussionService;
  }

  registerUser(data) {
    return this.discussionCsService.createUser(data);
  }

  getUserDetails(userId) {
    return this.discussionCsService.getUserDetails(userId);
  }

  getForumIds(data) {
    return this.discussionCsService.getForumIds(data);
  }

  attachForum(data) {
    return this.discussionCsService.attachForum(data);
  }

  removeForum(data) {
    return this.discussionCsService.removeForum(data);
  }

  createForum(data) {
    return this.discussionCsService.createForum(data);
  }

  fetchForumConfig(contentType) {
    const formServiceInputParams = {
      formType: 'forum',
      formAction: 'create',
      contentType: contentType
    };
    return this.formService.getFormConfig(formServiceInputParams);
  }
}

results matching ""

    No results matching ""