mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-18 11:49:08 +00:00
Find All
This commit is contained in:
@@ -11,15 +11,22 @@ import {
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { ApiConsumes, ApiTags } from '@nestjs/swagger';
|
||||
import { ConnectorManager } from '@victorradael/protospack-v2';
|
||||
import {
|
||||
ApiBasicAuth,
|
||||
ApiBearerAuth,
|
||||
ApiConsumes,
|
||||
ApiOAuth2,
|
||||
ApiTags,
|
||||
} from '@nestjs/swagger';
|
||||
import { ConnectorClientService } from 'src/clients/connector/client.service';
|
||||
import { AddTagDto } from './dtos/add-tag';
|
||||
import { CreateConnectorDto } from './dtos/create-connector';
|
||||
import { GetAllDto } from './dtos/get-all';
|
||||
import { RemoveTagDto } from './dtos/remove-tag';
|
||||
import { UpdateDto } from './dtos/update';
|
||||
|
||||
@ApiTags('connectors')
|
||||
@ApiBearerAuth()
|
||||
@Controller('connectors')
|
||||
export class ConnectorController {
|
||||
constructor(private connectorClientService: ConnectorClientService) {}
|
||||
@@ -32,22 +39,19 @@ export class ConnectorController {
|
||||
@Body() body: CreateConnectorDto,
|
||||
) {
|
||||
console.log(`/upload`, 'Upload Connector Route');
|
||||
console.log(file, body);
|
||||
|
||||
// const response = await this.connectorClientService.uploadConnector({
|
||||
// file: fileField.file,
|
||||
// connector: body.connector,
|
||||
// });
|
||||
const response = await this.connectorClientService.uploadConnector({
|
||||
file,
|
||||
connector: body,
|
||||
});
|
||||
|
||||
// console.log('X', response);
|
||||
console.log('X', response);
|
||||
|
||||
// return response;
|
||||
return response;
|
||||
}
|
||||
|
||||
@Get('/')
|
||||
async getAllConnectors(
|
||||
@Body() body: ConnectorManager.Messages.GetAllConnectorsRequest,
|
||||
) {
|
||||
@Post('/all')
|
||||
async getAllConnectors(@Body() body: GetAllDto) {
|
||||
console.log(`/upload`, 'Upload Connector Route');
|
||||
const { filters, search } = body;
|
||||
|
||||
@@ -56,9 +60,11 @@ export class ConnectorController {
|
||||
search,
|
||||
});
|
||||
|
||||
const connectors = JSON.parse(response.connectors).connectors;
|
||||
|
||||
return {
|
||||
message: response.message,
|
||||
connector: { ...JSON.parse(response.connector) },
|
||||
connectors,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user