Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ Pour accéder à l'aperçu de la version de production, visitez http://milestone
Voici les étapes à suivre pour se connecter en tant qu'administrateur :


1. Copier le fichier `.default` en `.env` avec la commande `cp .default .env` puis le remplir avec un nom d'utilisateur et un mot de passe admin.
1. Renommer le fichier `.default` en `.env` avec la commande `cp .default .env` puis le remplir avec un nom d'utilisateur et un mot de passe admin et vous avez la possibilite de laisser URL de base comme elle est ou la changer mais absolument l'indiquer.
URL de Base du serveur par defaut est : http://localhost:3000/api


2. `node prisma/seed.js` pour injecter les données dans la base de données.
2. Executer la commande `node prisma/seed.js` pour injecter les données dans la base de données.


3. Exécuter la commande `npx prisma generate` pour générer cet utilisateur avec le rôle admin.
Expand Down
2 changes: 1 addition & 1 deletion stores/discord.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const useDiscordStore = defineStore("discord", {
}),
actions: {
async fetchDiscordUser(jwt) {
const res = await fetch("http://localhost:3000/api/discord-id", {
const res = await fetch(`${import.meta.env.VITE_APP_API_URL}/discord-id`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Expand Down
8 changes: 4 additions & 4 deletions stores/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const useTaskStore = defineStore("tasks", {
actions: {
async setTasks() {
const res = await fetch(
"http://localhost:3000/api/task",
`${import.meta.env.VITE_APP_API_URL}/task`,
{
method: "GET",
}
Expand Down Expand Up @@ -38,7 +38,7 @@ export const useTaskStore = defineStore("tasks", {
async addTask(jwt, title, content, completed) {
console.log("addTask", title, content, completed, jwt);
const res = await fetch(
"http://localhost:3000/api/task",
`${import.meta.env.VITE_APP_API_URL}/task`,
{
method: "POST",
headers: {
Expand Down Expand Up @@ -73,7 +73,7 @@ export const useTaskStore = defineStore("tasks", {

async updateTask(jwt, id, title, content, completed, isContentPrivate) {
const res = await fetch(
"http://localhost:3000/api/task/" + id,
`${import.meta.env.VITE_APP_API_URL}/task/${id}` ,
{
method: "PUT",
headers: {
Expand Down Expand Up @@ -118,7 +118,7 @@ export const useTaskStore = defineStore("tasks", {
return;
}
const res = await fetch(
"http://localhost:3000/api/task/" + id,
`${import.meta.env.VITE_APP_API_URL}/task/${id}`,
{
//await fait attendre que toute la fonction soit déroulée
headers: {
Expand Down
10 changes: 5 additions & 5 deletions stores/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const useUserStore = defineStore("users", {
}),
actions: {
async setUsers(jwt) {
const res = await fetch("http://localhost:3000/api/user", {
const res = await fetch(`${import.meta.env.VITE_APP_API_URL}/user`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Expand All @@ -33,7 +33,7 @@ export const useUserStore = defineStore("users", {
},

async addUser(jwt, name, role, password, discordId, twitchId) {
const res = await fetch("http://localhost:3000/api/user", {
const res = await fetch(`${import.meta.env.VITE_APP_API_URL}/user`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down Expand Up @@ -74,7 +74,7 @@ export const useUserStore = defineStore("users", {
if (!conf) {
return;
}
const res = await fetch(`http://localhost:3000/api/user/${id}`, {
const res = await fetch(`${import.meta.env.VITE_APP_API_URL}/user/${id}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
Expand Down Expand Up @@ -104,7 +104,7 @@ export const useUserStore = defineStore("users", {
},

async updateUser(jwt, id, name, role, password, discordId, twitchId) {
const res = await fetch(`http://localhost:3000/api/user/${id}`, {
const res = await fetch(`${import.meta.env.VITE_APP_API_URL}/user/${id}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Expand Down Expand Up @@ -144,7 +144,7 @@ export const useUserStore = defineStore("users", {
async checkThirdPartyUserExistence(userId) {
try {
const res = await fetch(
`http://localhost:3000/api/third-party/${userId}`
`${import.meta.env.VITE_APP_API_URL}`/third-party/`${userId}`
);

const data = await res.json();
Expand Down