Skip to content

Commit 8d7404c

Browse files
committed
fix: applied host to define environment/branch
1 parent 3d3c59b commit 8d7404c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CoCreateUsage {
2626

2727
org = {}
2828
org.debounce = setTimeout(() => {
29-
self.send(org, organization_id); // Call the callback to display the count
29+
self.send(org, organization_id, data.host); // Call the callback to display the count
3030
self.organizations.delete(organization_id)
3131
}, 60000);
3232

@@ -54,7 +54,7 @@ class CoCreateUsage {
5454
}
5555

5656

57-
async send(org, organization_id) {
57+
async send(org, organization_id, host) {
5858
delete org.debounce
5959

6060
org.dataTransferedOut += 250
@@ -63,6 +63,7 @@ class CoCreateUsage {
6363
const platformOrganization = this.crud.config.organization_id
6464
let organization = await this.crud.send({
6565
method: 'object.read',
66+
host: this.crud.config.host,
6667
array: 'organizations',
6768
object: { _id: organization_id },
6869
organization_id: platformOrganization
@@ -103,6 +104,7 @@ class CoCreateUsage {
103104
isResetDataTransfer = true
104105
this.crud.send({
105106
method: 'object.create',
107+
host: this.crud.config.host,
106108
array: 'transactions',
107109
object: {
108110
organization_id,
@@ -130,6 +132,7 @@ class CoCreateUsage {
130132

131133
let balanceUpdate = {
132134
method: 'object.update',
135+
host: this.crud.config.host,
133136
array: 'organizations',
134137
object: { _id: organization_id },
135138
organization_id: platformOrganization,
@@ -154,6 +157,7 @@ class CoCreateUsage {
154157

155158
let transaction = {
156159
method: 'object.create',
160+
host,
157161
array: 'transactions',
158162
object: {
159163
organization_id,

0 commit comments

Comments
 (0)