From 89d2271729de47650251e6557d02b42c416f831f Mon Sep 17 00:00:00 2001 From: niyobertin Date: Mon, 1 Apr 2024 14:10:35 +0200 Subject: [PATCH] updates --- javaScript/formValidation.js | 2 +- local.storage/blogs.js | 10 +++++----- local.storage/blogs.list.js | 6 +++--- local.storage/contact.js | 2 +- local.storage/numbers.js | 4 ++-- local.storage/querries.js | 4 ++-- local.storage/signup.js | 2 +- local.storage/singleBlogs.js | 12 ++++++------ 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/javaScript/formValidation.js b/javaScript/formValidation.js index f0fd200..b562539 100644 --- a/javaScript/formValidation.js +++ b/javaScript/formValidation.js @@ -75,7 +75,7 @@ const form_validation = () =>{ const form = document.querySelector(".input-area"); const popMessage = document.querySelector(".pop-up"); const loginUser = async(email,password) =>{ - const loginUrl = "https://mybrand-be-nkyz.onrender.com/api/v1/users/login"; + const loginUrl = "https://mybrand-be-5zbq.onrender.com/api/v1/users/login"; displayLoading() fetch(loginUrl,{ method:'POST', diff --git a/local.storage/blogs.js b/local.storage/blogs.js index 842e14e..f619d43 100644 --- a/local.storage/blogs.js +++ b/local.storage/blogs.js @@ -13,7 +13,7 @@ const popUpMessage = document.querySelector(".pop-up-message") const log = JSON.parse(localStorage.getItem('logedInUser')) const token = log.token; const creatingBlogs = (data) =>{ - let url = "https://mybrand-be-nkyz.onrender.com/api/v1/blogs"; + let url = "https://mybrand-be-5zbq.onrender.com/api/v1/blogs"; displayLoading(); const formData = new FormData(); formData.append('title', data.title); @@ -67,7 +67,7 @@ const singleBlogsView = async(id) =>{ const hideLoading = () =>{ loader.classList.remove("display") } - const single_blog_url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${id}`; + const single_blog_url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${id}`; displayLoading() try{ const singleBlog = (await fetch(single_blog_url)).json(); @@ -91,7 +91,7 @@ const getlikes = async(id) => { const hideLoading = () =>{ loader.classList.remove("display") } - const likes_url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${id}/likes`; + const likes_url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${id}/likes`; displayLoading(); try { const likeNo = (await fetch(likes_url)).json(); @@ -131,7 +131,7 @@ const comments = async(id) =>{ const hideLoading = () =>{ loader.classList.remove("display") } - const coment_url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${id}/comments`; + const coment_url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${id}/comments`; displayLoading(); try { const AllComments = ((await fetch(coment_url)).json()); @@ -153,7 +153,7 @@ const fetchBlogs = async() =>{ const hideLoading = () =>{ loader.classList.remove("display") } - const url = 'https://mybrand-be-nkyz.onrender.com/api/v1/blogs'; + const url = 'https://mybrand-be-5zbq.onrender.com/api/v1/blogs'; displayLoading(); try{ let response = (await fetch(url)).json(); diff --git a/local.storage/blogs.list.js b/local.storage/blogs.list.js index a76913e..517d116 100644 --- a/local.storage/blogs.list.js +++ b/local.storage/blogs.list.js @@ -10,7 +10,7 @@ const hideLoading = () =>{ } const blogList = document.getElementById('blog-list'); const fetchBlogs = async() =>{ - const url = 'https://mybrand-be-nkyz.onrender.com/api/v1/blogs'; + const url = 'https://mybrand-be-5zbq.onrender.com/api/v1/blogs'; displayLoading(); try{ let response = (await fetch(url)).json(); @@ -73,7 +73,7 @@ const popMessage = document.querySelector(".alet"); const loggedIn = JSON.parse(localStorage.getItem('logedInUser')) const token = loggedIn.token; const deletBlogs = (id) => { - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${id}`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${id}`; console.log(displayLoading()) fetch(url, { method: 'DELETE', @@ -116,7 +116,7 @@ const deletBlogs = (id) => { const fetchBlogData = async() => { const blogId = localStorage.getItem('blogsId'); - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${blogId}`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${blogId}`; const response = await fetch(url, { method: 'GET' }) diff --git a/local.storage/contact.js b/local.storage/contact.js index 0cba033..83eb67b 100644 --- a/local.storage/contact.js +++ b/local.storage/contact.js @@ -14,7 +14,7 @@ const popMessage = document.querySelector(".pop-up-message"); const send_button = document.getElementById('send-message'); const form = document.querySelector('.input-area'); const sendQuerries = (data) =>{ - let url = "https://mybrand-be-nkyz.onrender.com/api/v1/querries"; + let url = "https://mybrand-be-5zbq.onrender.com/api/v1/querries"; displayLoading(); fetch(url,{ method:'POST', diff --git a/local.storage/numbers.js b/local.storage/numbers.js index f5292fa..66bc42e 100644 --- a/local.storage/numbers.js +++ b/local.storage/numbers.js @@ -3,7 +3,7 @@ const token = loggedIn.token; if(!token){ console.log("LOGIN"); }else{ - const querriesUl = "https://mybrand-be-nkyz.onrender.com/api/v1/querries" + const querriesUl = "https://mybrand-be-5zbq.onrender.com/api/v1/querries" fetch(querriesUl,{ method:'GET', headers:{ @@ -23,7 +23,7 @@ if(!token){ if(!token){ console.log("LOGIN"); }else{ - const querriesUl = "https://mybrand-be-nkyz.onrender.com/api/v1/blogs" + const querriesUl = "https://mybrand-be-5zbq.onrender.com/api/v1/blogs" fetch(querriesUl,{ method:'GET' }) diff --git a/local.storage/querries.js b/local.storage/querries.js index 2338983..1a5c0b4 100644 --- a/local.storage/querries.js +++ b/local.storage/querries.js @@ -16,7 +16,7 @@ const token = loggedIn.token; if(!token){ console.log("LOGIN"); }else{ - const querriesUl = "https://mybrand-be-nkyz.onrender.com/api/v1/querries" + const querriesUl = "https://mybrand-be-5zbq.onrender.com/api/v1/querries" displayLoading() fetch(querriesUl,{ method:'GET', @@ -59,7 +59,7 @@ if(!token){ } const popMessage = document.querySelector(".pop-up"); const deletequerry = (id,token) =>{ - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/querries/${id}`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/querries/${id}`; fetch(url, { method: 'DELETE', headers: { diff --git a/local.storage/signup.js b/local.storage/signup.js index 2dc68db..ec08bfd 100644 --- a/local.storage/signup.js +++ b/local.storage/signup.js @@ -12,7 +12,7 @@ loader.classList.remove("display") } const popMessage = document.querySelector(".pop-up-message"); const siginUp = (data) =>{ - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/users`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/users`; displayLoading(); fetch(url,{ method:'POST', diff --git a/local.storage/singleBlogs.js b/local.storage/singleBlogs.js index cb0ea71..0f94960 100644 --- a/local.storage/singleBlogs.js +++ b/local.storage/singleBlogs.js @@ -24,7 +24,7 @@ const getLikes = () =>{ if(!id){ return "this is not allowed"; }else{ - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${blogToAddLikesOn}/likes`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${blogToAddLikesOn}/likes`; displayLoading(); try { fetch(url, { @@ -61,7 +61,7 @@ const singleView = document.querySelector(".singleView"); if(!id){ console.log('blog Not found') }else{ - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${id}`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${id}`; displayLoading(); try{ fetch(url,{ @@ -92,7 +92,7 @@ const sendComment = (data) => { if(!id){ return; }else{ - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${id}/comments`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${id}/comments`; displayLoading(); try { fetch(url, { @@ -134,7 +134,7 @@ sendCommentButton.addEventListener('click',(event) =>{ }) const displayComments = () => { - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${id}/comments`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${id}/comments`; displayLoading(); fetch(url,{ method:"GET", @@ -174,7 +174,7 @@ const addLikes = () =>{ if(!id){ return; }else{ - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${blogToAddLikesOn}/likes`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${blogToAddLikesOn}/likes`; displayLoading(); try { fetch(url, { @@ -253,7 +253,7 @@ function checkLikedStatus(blogId, userId, token) { console.error('Blog ID, user ID, or token is missing.'); return; } - const url = `https://mybrand-be-nkyz.onrender.com/api/v1/blogs/${blogId}/likes`; + const url = `https://mybrand-be-5zbq.onrender.com/api/v1/blogs/${blogId}/likes`; fetch(url, { method: 'GET', headers: {