mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-12 21:39:08 +00:00
FIX: fixed customer and role id
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import DadosferaLogger from '@dadosfera/dadosfera-logs';
|
||||
import { Body, Controller, Inject, Post, UseFilters } from '@nestjs/common';
|
||||
import { ApiCreatedResponse, ApiHeaders, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiCreatedResponse, ApiHeaders, ApiOkResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiInternalOnlyController } from 'src/decorators/swagger.decorator';
|
||||
import { GrpcToHttpExceptionFilter } from 'src/error/grpc-to-http-exception.filter';
|
||||
import { LanguageEnum } from 'src/utils/languages.enum';
|
||||
@@ -26,7 +26,7 @@ export class OpenDataController {
|
||||
}
|
||||
|
||||
@Post("/sharing-ocean-data")
|
||||
@ApiCreatedResponse()
|
||||
@ApiOkResponse()
|
||||
async createUser(
|
||||
@Body()
|
||||
body: WordpressForm
|
||||
@@ -34,10 +34,12 @@ export class OpenDataController {
|
||||
this.logger.info('createUser for open data' + JSON.stringify({ body }));
|
||||
|
||||
// "401573bb-334f-44b2-b30e-88d4cea31ae9"
|
||||
const OPENDATA_PUBLIC_USERS_GROUP_ID = process.env.OPEN_GROUP_ID;
|
||||
// const OPENDATA_PUBLIC_USERS_GROUP_ID = process.env.OPEN_GROUP_ID;
|
||||
// ""f239718a-a271-4ef9-ae7e-02a2f0f3aa6e""
|
||||
const OPENDATA_CUSTOMER_ID = process.env.OPEN_CUSTOMER_ID;
|
||||
const roles = [OPENDATA_PUBLIC_USERS_GROUP_ID];
|
||||
// const OPENDATA_CUSTOMER_ID = process.env.OPEN_CUSTOMER_ID;
|
||||
const OPENDATA_CUSTOMER_ID = "bb4e9b26-d465-40ff-9345-e768ca69a55e";
|
||||
|
||||
const roles = ["4d621501-5ea4-444b-b46e-1a009f3132ff"];
|
||||
|
||||
const data = {}
|
||||
|
||||
@@ -60,10 +62,11 @@ export class OpenDataController {
|
||||
lastName: data["last_name"],
|
||||
organization: data["organization"]
|
||||
}
|
||||
this.logger.info('user data' + JSON.stringify({ user }));
|
||||
this.logger.info('user request' + JSON.stringify({ user, roles, customer: OPENDATA_CUSTOMER_ID }));
|
||||
|
||||
try {
|
||||
await this.openDataService.createUser(OPENDATA_CUSTOMER_ID, user, roles);
|
||||
const response = await this.openDataService.createUser(OPENDATA_CUSTOMER_ID, user, roles);
|
||||
this.logger.info('user created with sucessfull data' + JSON.stringify(response));
|
||||
return "success"
|
||||
} catch (e) {
|
||||
this.logger.error('user data' + e.message);
|
||||
|
||||
Reference in New Issue
Block a user