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
res.status(200).json({status: 'success',message: 'Your commission was created successfully.'});
193
193
});
194
194
195
+
app.put('/sync',async(req,res)=>{
196
+
if(!on)returnres.status(503).json({status: 'error',message: 'Service is currently offline.'});
197
+
if(!req.session)returnres.status(401).json({status: 'error',message: 'No session found. Please enable cookies and try again.'});
198
+
if(tenant.auth&&tenant.auth.enabled&&vars.userId&&!req.session[vars.userId])returnres.status(401).json({status: 'error',message: 'User not authenticated. Please log in and try again.'});
199
+
if(!tenant.slug||!tenant.name||!tenant.domain)returnres.status(500).json({status: 'error',message: 'Service is not properly configured. Please contact the administrator.'});
200
+
if(syncHandler&&typeofsyncHandler==='function'){
201
+
try{
202
+
awaitsyncHandler(req);
203
+
}catch(error){
204
+
console.error('Error in handler function:',error);
205
+
returnres.status(500).json({status: 'error',message: 'An error occurred while processing your request. Please try again later.'});
206
+
};
207
+
};
208
+
res.status(200).json({status: 'success',message: 'Your commissions were synchronized successfully.'});
209
+
});
210
+
195
211
app.use((req,res)=>{
196
212
res.status(404).render('error',{ tenant,title: 'Not Found',message: 'The requested resource was not found.'});
0 commit comments