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
2 changes: 1 addition & 1 deletion src/components/ConfigUserPopUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const ConfigUserPopUp = ({ open, onClose, username, bio, profilePic, setProfileP
profilePicUrl = await uploadToCloudinary(changedProfilePic);
}

const res = await fetch("http://localhost:5000/api/config", {
const res = await fetch("https://groover-api.onrender.com/api/config", {
method: "PUT",
headers: {
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion src/components/FollowButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const FollowButton = ({ followingId, userId, following }) => {
setLoading(true);
const token = localStorage.getItem('token');

const response = await fetch('http://localhost:5000/api/follow', {
const response = await fetch('https://groover-api.onrender.com/api/follow', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/components/PostFormPopUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const PostFormPopUp = ({ open, onClose, projects }) => {
);
}

const response = await fetch("http://localhost:5000/api/post", {
const response = await fetch("https://groover-api.onrender.com/api/post", {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion src/components/SharePopUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SharePopUp = ({ open, onClose, project }) => {
const token = localStorage.getItem("token");
console.log("Usernameeeee inputttttt")
console.log(usernameInput)
const response = await fetch(`http://localhost:5000/api/projects/${project.id}/invite`, {
const response = await fetch(`https://groover-api.onrender.com/api/projects/${project.id}/invite`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useForkProject.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function useForkProject(token) {
setLoading(true);
try {
console.log(projectId)
const response = await fetch(`http://localhost:5000/api/fork`, {
const response = await fetch(`https://groover-api.onrender.com/api/fork`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useLikePost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function useLikePost(token, onSuccess) {

const likePost = async (post_id) => {
try {
const res = await fetch("http://localhost:5000/api/post/like", {
const res = await fetch("https://groover-api.onrender.com/api/post/like", {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useShareProject.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function useShareProject(token) {
const shareProject = async (username) => {
setLoading(true);
try {
const response = await fetch(`http://localhost:5000/api/invite`, {
const response = await fetch(`https://groover-api.onrender.com/api/invite`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/editor/[id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ function EditorPage() {
projectData.midi = midiBase64;
console.log(projectData.midi)
try {
const response = await fetch('http://localhost:5000/api/projects', {
const response = await fetch('https://groover-api.onrender.com/api/projects', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -812,7 +812,7 @@ function EditorPage() {
console.log(projectId)

try {
const response = await fetch(`http://localhost:5000/api/projects/${projectId}`, {
const response = await fetch(`https://groover-api.onrender.com/api/projects/${projectId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${tokenJWT}`
Expand Down
4 changes: 2 additions & 2 deletions src/pages/editor/view/[id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ function EditorPage() {
projectData.title = title + " (Fork)"

try {
const response = await fetch('http://localhost:5000/api/projects', {
const response = await fetch('https://groover-api.onrender.com/api/projects', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -801,7 +801,7 @@ function EditorPage() {
console.log(projectId)

try {
const response = await fetch(`http://localhost:5000/api/projects/${projectId}`, {
const response = await fetch(`https://groover-api.onrender.com/api/projects/${projectId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${tokenJWT}`
Expand Down
4 changes: 2 additions & 2 deletions src/pages/feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Feed() {
setLoading(true);
setError("");
try {
const res = await fetch("http://localhost:5000/api/post", {
const res = await fetch("https://groover-api.onrender.com/api/post", {
headers: {
Authorization: `Bearer ${token}`,
},
Expand Down Expand Up @@ -82,7 +82,7 @@ function Feed() {

const fetchSimilarUsers = async (token) => {
try {
const res = await fetch("http://localhost:5000/api/user/similar", {
const res = await fetch("https://groover-api.onrender.com/api/user/similar", {
headers: {
Authorization: `Bearer ${token}`,
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const LoginPage = () => {
const handleSubmit = async (e) => {
e.preventDefault();
try {
const response = await fetch('http://localhost:5000/api/signin', {
const response = await fetch('https://groover-api.onrender.com/api/signin', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/logon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const LoginPage = () => {
e.preventDefault();

try {
const response = await fetch('http://localhost:5000/api/signup', {
const response = await fetch('https://groover-api.onrender.com/api/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/p/[id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function PostPage() {
};
const fetchPost = async (postId, token) => {
try {
const res = await fetch(`http://localhost:5000/api/post/${postId}`, {
const res = await fetch(`https://groover-api.onrender.com/api/post/${postId}`, {
headers: {
Authorization: `Bearer ${token}`,
},
Expand Down
12 changes: 6 additions & 6 deletions src/pages/profile/[user].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function Profile() {
if (!username || !token) return;

try {
const res = await fetch(`http://localhost:5000/api/user/${username}`, {
const res = await fetch(`https://groover-api.onrender.com/api/user/${username}`, {
headers: { Authorization: `Bearer ${token}` },
});

Expand Down Expand Up @@ -114,7 +114,7 @@ export default function Profile() {

const fetchUserProjects = async (token, user) => {
try {
const response = await fetch(`http://localhost:5000/api/projects/user/${user}`, {
const response = await fetch(`https://groover-api.onrender.com/api/projects/user/${user}`, {
headers: { Authorization: `Bearer ${token}` },
});
if (!response.ok) throw new Error("Erro ao carregar projetos");
Expand All @@ -133,7 +133,7 @@ export default function Profile() {
const fetchPosts = async (token) => {
setLoading(true);
try {
const res = await fetch(`http://localhost:5000/api/post/username/${user}`, {
const res = await fetch(`https://groover-api.onrender.com/api/post/username/${user}`, {
headers: { Authorization: `Bearer ${token}` },
});
if (!res.ok) throw new Error("Erro ao carregar posts");
Expand All @@ -151,7 +151,7 @@ export default function Profile() {
const fetchInvites = async (token) => {
setLoading(true);
try {
const res = await fetch(`http://localhost:5000/api/invitations`, {
const res = await fetch(`https://groover-api.onrender.com/api/invitations`, {
headers: { Authorization: `Bearer ${token}` },
});
if (!res.ok) throw new Error("Erro ao carregar invites");
Expand All @@ -178,7 +178,7 @@ export default function Profile() {
const handleClickAccept = async (inviteId) => {
setLoading(true);
try {
const response = await fetch(`http://localhost:5000/api/invitations/${inviteId}/respond`, {
const response = await fetch(`https://groover-api.onrender.com/api/invitations/${inviteId}/respond`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand All @@ -204,7 +204,7 @@ export default function Profile() {
const handleClickReject = async (inviteId) => {
setLoading(true);
try {
const response = await fetch(`http://localhost:5000/api/invitations/${inviteId}/respond`, {
const response = await fetch(`https://groover-api.onrender.com/api/invitations/${inviteId}/respond`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion src/util/upload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function uploadToCloudinary(file) {
const formData = new FormData();
formData.append("file", file);

const res = await fetch("http://localhost:5000/api/upload-image", {
const res = await fetch("https://groover-api.onrender.com/api/upload-image", {
method: "POST",
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
Expand Down