Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
niyobertin committed Apr 1, 2024
1 parent 253c34d commit 89d2271
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion javaScript/formValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 5 additions & 5 deletions local.storage/blogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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());
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions local.storage/blogs.list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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'
})
Expand Down
2 changes: 1 addition & 1 deletion local.storage/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions local.storage/numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:{
Expand All @@ -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'
})
Expand Down
4 changes: 2 additions & 2 deletions local.storage/querries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion local.storage/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 6 additions & 6 deletions local.storage/singleBlogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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,{
Expand Down Expand Up @@ -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, {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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, {
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 89d2271

Please sign in to comment.