Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/initial commit #1

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Feat/initial commit #1

wants to merge 28 commits into from

Conversation

medtaher123
Copy link
Collaborator

No description provided.

import { Injectable } from '@nestjs/common';
import { EventEmitter2, OnEvent } from '@nestjs/event-emitter';
import { NextFunction, Request, Response } from 'express';
import fetch from 'node-fetch';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not use "node-fetch", you can use the httpService instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attachmentService.uploadProfilePic requires a fetch.Response argument. We’ll either need to keep using fetch or modify the uploadProfilePic method to accommodate HttpService.

index.channel.ts Outdated Show resolved Hide resolved
index.channel.ts Outdated Show resolved Hide resolved
index.channel.ts Outdated Show resolved Hide resolved
index.channel.ts Outdated Show resolved Hide resolved
Comment on lines +42 to +48
const axiosInstance = axios.create({
baseURL: 'https://slack.com/api',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
Authorization: `Bearer ${access_token}`,
},
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we use the nestjs axios wrapper object instead ? I think you can create a child instance so that you define interceptors.

slack-api.ts Outdated Show resolved Hide resolved
slack-api.ts Outdated Show resolved Hide resolved
slack-api.ts Outdated Show resolved Hide resolved
verify-request.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants