mirror of
https://github.com/docmost/docmost.git
synced 2026-08-27 05:42:11 +10:00
feat: add version check (#922)
* Add version endpoint * version indicator * refetch * * Translate strings * Handle error
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
Controller,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
NotFoundException,
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { VersionService } from './version.service';
|
||||
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
|
||||
import { EnvironmentService } from '../environment/environment.service';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Controller('version')
|
||||
export class VersionController {
|
||||
constructor(
|
||||
private readonly versionService: VersionService,
|
||||
private readonly environmentService: EnvironmentService,
|
||||
) {}
|
||||
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Post()
|
||||
async getVersion() {
|
||||
if (this.environmentService.isCloud()) throw new NotFoundException();
|
||||
return this.versionService.getVersion();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user