1.0.2 • Published 2 years ago

mtr-following v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Meteor Following Library

Meteor Following Library

Dokumentasi

Configurasi

Tambahkan pada .env.

SVC_FLW= https://dev.svcgateway.meteor.co.id
SVC_ID= ********-****-****-****-************

Tambahkan midleware di app.js tepat setelah auth midleware

const { configExpress } = require('following');

//asumsi app adalah express()
//notes letakkan setelah auth
app.use(configExpress);

Following

 const following = require('following');

//Content Id 
 const contentId = 'example-idContent';
 
//Type 
 const type = "article" //example


//Untuk Follow atau Unfollow
const follow =  await following.create(type, contentId);
 
//Untuk mengecek apakah user follow atau tidak
const checkFollow = await following.check(type, contentId)
 
// Untuk melihat list data apa saja yang di follow oleh user
// paramater svcId dan type untuk melihat list content tiap type
//jika parameter ini tidak di isi maka akan result semua list yang di follow oleh user
const listFollow = await following.index(page, length, svcId, type)


// Untuk melihat list User siapa saja yang di follow di content tersebut
const followerList = await following.indexAdmin(type, contentId, page, length)