33 lines
759 B
TypeScript
33 lines
759 B
TypeScript
import {
|
|
Controller,
|
|
Get,
|
|
Redirect,
|
|
Render,
|
|
Req,
|
|
Session,
|
|
} from '@nestjs/common';
|
|
import { Request } from 'express';
|
|
import { SessionData } from 'express-session';
|
|
import { FormUtilityService } from 'src/modules/utility/services/form-utility.service';
|
|
import { SettingsService } from './settings.service';
|
|
|
|
@Controller('/account')
|
|
export class SettingsController {
|
|
constructor(
|
|
private readonly _service: SettingsService,
|
|
private readonly _form: FormUtilityService,
|
|
) {}
|
|
|
|
@Get()
|
|
@Redirect('/account/general')
|
|
public redirectGeneral() {
|
|
return;
|
|
}
|
|
|
|
@Get('general')
|
|
@Render('settings/general')
|
|
public general(@Req() req: Request, @Session() sess: SessionData) {
|
|
return this._form.populateTemplate(req, sess);
|
|
}
|
|
}
|