Skip to content
Snippets Groups Projects
Commit 09aac81e authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

Correções nas rotas para rodar na VM

parent 784ce926
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ load_dotenv('../.env')
es_host = os.getenv('ELASTICSEARCH_HOST')
es_port = os.getenv('ELASTICSEARCH_PORT')
es_host = 'https://' + es_host
index_prefix = os.getenv('ELASTIC_INDEX_PREFIX')
# Elasticsearch credentials
......@@ -18,9 +18,9 @@ es_password = os.getenv('ELASTICSEARCH_PASSWORD')
print(es_host, es_port, es_password, es_username, index_prefix)
lo_file_path = './csvs/lo.csv'
users_file_path = './csvs/users.csv'
collections_file_path = './csvs/collections.csv'
lo_file_path = './csv/resources.csv'
users_file_path = './csv/users.csv'
collections_file_path = './csv/collections.csv'
def read_lo_metadata(csv_file_path):
print("\n\nREADING LOS\n\n")
......@@ -121,7 +121,8 @@ def index_metadata_to_elasticsearch(metadata, index):
f'{es_host}:{es_port}/{index_prefix}_{index}/_doc',
headers={"Content-Type": "application/json"},
data=json.dumps(es_doc),
auth=(es_username, es_password) # Pass credentials here
auth=(es_username, es_password),
verify=False
)
print(response.json())
......
......@@ -51,7 +51,6 @@ export class UserRoleRepo{
.from(userRoleRelationTable)
.innerJoin(roleTable, eq(userRoleRelationTable.role_id, roleTable.id))
.where(eq(userRoleRelationTable.user_id, user_id));
console.log("OIIIIIIIIIIIIIIII", result)
return result.map(r => r.role);
}
......@@ -64,7 +63,6 @@ export class UserRoleRepo{
async create(userRoleRelation: UserRoleRelationInput, tx?: db): Promise<UserRoleRelationModel> {
const repo = tx ?? db
console.log(userRoleRelation)
const [ret] = await repo
.insert(userRoleRelationTable)
......
......@@ -33,8 +33,6 @@ const EnvSchema = z.object({
FRONT_END_URL: z.string(),
FRONT_END_TOKEN_RETURN_URL: z.string(),
FRONT_END_SIGNOUT_URL: z.string(),
URL: z.string(),
FRONT_END_RETURN_URL: z.string(),
EMAIL_URL: z.string(),
ELASTICSEARCH_USER: z.string(),
......
......@@ -57,15 +57,12 @@ export const userRouter = honoWithJwt()
try {
const user = userSchemas.userProfileSchema.parse(await service.findById(userId));
const relations = await serviceRole.findByUserId(userId);
const roles = (
await Promise.all(
relations.map(async (rel) => {
const r = await serviceRole.findInfoByIdRole(rel.role_id);
const r = await serviceRole.findInfoByIdRole(rel.id);
return r.name;
})
)
)
//retorna usuario com permissoes
const userWithRoles = {
......
......@@ -123,7 +123,6 @@ export const checkElasticsearchConnection = async () => {
export const ensureIndexesExist = async () => {
for (const [indexName, config] of Object.entries(indexMappings)) {
console.log("oiiiiiiiiiiiiii")
if (!indexName) {
console.error('❌ Invalid index name:', indexName)
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment