-first commit

This commit is contained in:
2025-11-11 12:36:06 +07:00
commit b99c214434
5683 changed files with 713336 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { RegisterService } from '../services/registerservice.js';
import { sendError } from '../utils/response.js';
import { GeneralService } from '../share/generalservice.js';
export class RegisterController {
constructor() {
this.registerService = new RegisterService();
this.generalService = new GeneralService();
}
async onNavigate(req, res) {
let idx = -1, result = [];
try {
const { organization, request } = req.body;
const { email, fname, lname, password } = request;
result = await this.registerService.requestRegistration(organization, email, fname, lname, password);
} catch (error) {
idx = 1;
this.generalService.devhint(1, 'registercontroller.js', 'Jumpout', error.message);
result = error; // จะถูก Global Handler จัด format
} finally {
if (idx === 1) return result;
return result;
}
}
}