MCPcopy
hub / github.com/linuxfoundation/crowd.dev / getTenatUser

Function getTenatUser

backend/src/segment/trackHelper.ts:3–19  ·  view source on GitHub ↗
(userId, options)

Source from the content-addressed store, hash-verified

1import SequelizeRepository from '../database/repositories/sequelizeRepository'
2
3export default function getTenatUser(userId, options) {
4 let userIdOut
5 if (!userId) {
6 // Get current user
7 userIdOut = SequelizeRepository.getCurrentUser({
8 ...options,
9 }).id
10 } else {
11 userIdOut = userId
12 }
13
14 const tenantIdOut = SequelizeRepository.getCurrentTenant({ ...options }).id
15 return {
16 userIdOut,
17 tenantIdOut,
18 }
19}

Callers 2

trackFunction · 0.85
identifyFunction · 0.85

Calls 2

getCurrentUserMethod · 0.80
getCurrentTenantMethod · 0.45

Tested by

no test coverage detected