You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,11 +88,23 @@ commtrackr.init({ // Initialize CommTracker with configurations
88
88
],
89
89
},
90
90
],
91
-
handler: (data) => {
92
-
// Custom handler function for processing commission data
93
-
// This function is called when a commission is created or updated
94
-
// You can implement your own logic here, such as saving to a database
95
-
}
91
+
handlers: {
92
+
create: (req, data) => {
93
+
// Custom handler function for processing commission data
94
+
// This function is called when a commission is created
95
+
// You can implement your own logic here, such as saving to a database
96
+
},
97
+
update: (req, data) => {
98
+
// Custom handler function for updating commission data
99
+
// This function is called when a commission is updated
100
+
// You can implement your own logic here, such as saving to a database
101
+
},
102
+
sync: (req) => {
103
+
// Custom handler function for syncing user's commissions
104
+
// This function is called when the user manually triggers a sync
105
+
// You can implement your own logic here, such as syncing your commissions session variable
106
+
},
107
+
},
96
108
});
97
109
98
110
app.listen(3000, () => {
@@ -178,7 +190,7 @@ Session Example:
178
190
[
179
191
{
180
192
id:'unique-commission-id', // Unique identifier for the commission
181
-
client:'Client Name', //Name of the client
193
+
user:'userId', //Commission creator's unique userId. Should match the userId variable, otherwise the commission will only be accessible in admin/dev views
182
194
amount:1000, // Commission amount, or null if not applicable
183
195
currency:'USD', // Currency code for the commission amount
0 commit comments