forked from ToolJet/ToolJet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.ts
More file actions
80 lines (72 loc) · 2.4 KB
/
controller.ts
File metadata and controls
80 lines (72 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { Controller, Get, Post, Put, Param, Body, Delete, Query, NotFoundException } from '@nestjs/common';
import { User } from '@modules/app/decorators/user.decorator';
import {
OrganizationGitCreateDto,
OrganizationGitStatusUpdateDto,
OrganizationGitUpdateDto,
} from '@dto/organization_git.dto';
import { User as UserEntity } from 'src/entities/user.entity';
import { IGitSyncController } from './Interfaces/IController';
import { ProviderConfigDTO } from './dto/provider-config.dto';
import { InitModule } from '@modules/app/decorators/init-module';
import { MODULES } from '@modules/app/constants/modules';
@Controller('git-sync')
@InitModule(MODULES.GIT_SYNC)
export class GitSyncController implements IGitSyncController {
constructor() {}
@Get(':id/status')
async getOrgGitStatusByOrgId(@User() user: UserEntity, @Param('id') organizationId: string): Promise<any> {
throw new NotFoundException();
}
@Post()
async create(
@User() user: UserEntity,
@Body() orgGitCreateDto: OrganizationGitCreateDto,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
@Put(':id')
async update(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Body() orgGitUpdateDto: OrganizationGitUpdateDto,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
@Put('finalize/:id')
async setFinalizeConfig(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Body() configDto: ProviderConfigDTO,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
@Put('status/:id')
async changeStatus(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Body() organizationGitStatusUpdateDto: OrganizationGitStatusUpdateDto
) {
throw new NotFoundException();
}
@Delete(':id')
async deleteConfig(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
// IMPORTANT : Don't modify this caution : Keep this endpoint last until refactored to avoid conflict with routes using ':id', which may lead to misinterpretation of parameters (e.g., 'gitpull').
@Get(':id')
async getOrgGitByOrgId(
@User() user: UserEntity,
@Param('id') organizationId: string,
@Query('gitType') gitType: string
): Promise<any> {
throw new NotFoundException();
}
}