Skip to content

Commit

Permalink
version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Aromiii committed Feb 18, 2023
1 parent 3164def commit 74cd480
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suppis-nettisivut",
"version": "2.0.0-Beta",
"version": "1.0.0-rc.1",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
Expand Down
27 changes: 2 additions & 25 deletions src/pages/message.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {useEffect, useState} from "react";
import {getAppCheckTokenForApiCall, getIdTokenForApiCall} from "../firebaseConfig";
import {auth, getAppCheckTokenForApiCall, getIdTokenForApiCall} from "../firebaseConfig";
import axios, {AxiosResponse} from "axios";
import {onAuthStateChanged} from "firebase/auth";

const Papa = require("papaparse")

Expand All @@ -12,30 +13,6 @@ export default function MessageWrapper() {
const [showQr, setShowQr] = useState(false)
const [selectedFile, setSelectedFile] = useState<File | null>(null)

useEffect(() => {
const x = async () => {
try {

// Getting tokens from Firebase to send along the API request, so backend can ensure that user has correct access rights
const idToken = await getIdTokenForApiCall()
const appCheckToken = await getAppCheckTokenForApiCall()

const result: AxiosResponse = await axios.get("http://localhost:3001/whatsapp/status", {
headers: {
"X-Firebase-IdToken": idToken,
"X-Firebase-AppCheck": appCheckToken.token
}
})

console.log(result.data)

} catch (error: any) {
handleMessageApiCallResponse(error)
}
}
x()
}, [])

const setFile = (event: any) => {
setSelectedFile(event.target.files[0])
}
Expand Down

0 comments on commit 74cd480

Please sign in to comment.