mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
Merge pull request #732 from ma1ted/slack-api-fix
Fix Slack API error when there is no token present
This commit is contained in:
commit
5f8bb92bbe
1 changed files with 3 additions and 1 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import FormData from 'form-data'
|
||||
|
||||
export async function Slack() {
|
||||
if (!process.env.SLACK_API_TOKEN) return { error: 'No Slack API token found!' }
|
||||
|
||||
const formData = new FormData()
|
||||
|
||||
formData.append('token', process.env.SLACK_API_TOKEN || 'invalid_no_slack_token')
|
||||
formData.append('token', process.env.SLACK_API_TOKEN)
|
||||
formData.append('date_range', '30d')
|
||||
|
||||
let slackData = await fetch(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue