Changes in times and Dashboard

This commit is contained in:
2024-03-19 13:13:41 +01:00
parent 66ee33cdde
commit 34096f877a
9 changed files with 322 additions and 421 deletions

View File

@@ -4,10 +4,16 @@ import {createClient} from "@supabase/supabase-js";
import vCardsJS from "vcards-js"
import cors from 'cors'
import axios from "axios"
import basicAuth from "express-basic-auth"
const supabase = createClient(process.env.SUPABASE_URL,process.env.SUPABASE_SERVICE_ROLE_KEY)
const app = express();
app.use(cors())
app.use(basicAuth({
users: {
frontend: "Xt9Zn9RDSpdbr"
}
}))
/*
* TODO: Implement Auth for the Endpoints
@@ -35,7 +41,7 @@ const getGoCardlessToken = async () => {
}
app.get("/contacts/:tenantId", async (req,res) => {
/*app.get("/contacts/:tenantId", async (req,res) => {
const tenantId = req.params.tenantId
let contacts = (await supabase.from("contacts").select().eq("tenant", tenantId)).data
let customers = (await supabase.from("customers").select().eq("tenant", tenantId)).data
@@ -66,7 +72,7 @@ app.get("/contacts/:tenantId", async (req,res) => {
//send the response
res.send(cardsString);
})
})*/
app.get('/calendar/:userId', async (req, res) => {
@@ -105,7 +111,7 @@ app.get('/calendar/:userId', async (req, res) => {
}
});
app.get("/banking/token", async (req,res) => {
/*app.get("/banking/token", async (req,res) => {
if(goCardlessAccessToken) {
res.json({
token: goCardlessAccessToken
@@ -116,7 +122,7 @@ app.get("/banking/token", async (req,res) => {
token: goCardlessAccessToken
})
}
})
})*/
app.get('/banking/institutions/:bic?', async (req,res) => {