Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadarif03 committed Nov 20, 2024
1 parent d748271 commit 950984d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
12 changes: 7 additions & 5 deletions resources/views/user/layouts/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,13 @@ function selectSubcategory(value) {
$('.photo-user').attr('src', profileImage1);
},
error: function(xhr) {
Swal.fire({
title: "Terjadi Kesalahan!",
text: "Tidak dapat memuat data profil.",
icon: "error"
});
if (response.status === 401) {
Swal.fire({
title: "Terjadi Kesalahan!",
text: "Tidak dapat memuat data profil.",
icon: "error"
});
}
}
});
});
Expand Down
30 changes: 14 additions & 16 deletions resources/views/user/pages/scripts/blogs.blade.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
<script>
$(document).ready(function() {
$.ajax({
type: "GET"
, url: "{{ config('app.api_url') }}" + "/api/blogs"
, headers: {
type: "GET",
url: "{{ config('app.api_url') }}" + "/api/blogs",
headers: {
Authorization: 'Bearer ' + "{{ session('hummaclass-token') }}"
}
, dataType: "json"
, success: function(response) {
},
dataType: "json",
success: function(response) {
$('#news-content').empty();
if (response.data.data.length > 0) {
$.each(response.data.data, function(index, value) {
// if (index < 8) {
$('#news-content').append(card(index, value));
$('#news-content').append(card(index, value));
// }
});
renderPagination(response.data.paginate.last_page, response.data.paginate
.current_page
, function(page) {
.current_page,
function(page) {
handleGetEvents(page);
});
} else {
$('#news-content').append(empty());
}
if (courseData.length === 8) {
$('#other-news').show();
} else {
$('#other-news').hide();
}
}
, error: function(xhr) {
},
error: function(xhr) {
Swal.fire({
title: "Terjadi Kesalahan!"
, text: "Tidak dapat memuat data kategori."
, icon: "error"
title: "Terjadi Kesalahan!",
text: "Tidak dapat memuat data kategori.",
icon: "error"
});
}
});
Expand Down Expand Up @@ -70,5 +69,4 @@ function card(index, value) {
// jangan dihapus
// <li><i class="flaticon-user-1"></i>by <a href="blog-details.html">Admin</a></li>
</script>

0 comments on commit 950984d

Please sign in to comment.