mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
Improve paste handling and pagination logic
- Updated `PasteController.cs` to enhance visibility parameter handling and added methods for retrieving pastes with pagination and error handling. - Added `UID` property to the `Paste` class for better identification. - Refactored `Program.cs` to remove unused namespaces and improve response header handling. - Enhanced `DatabaseService.cs` with new methods for retrieving pastes and user pastes, including better error handling. - Adjusted pagination logic in `archive.js` and `dash.js` to start from page 1, improving user interface navigation.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
let currentPage = 1;
|
||||
let totalPages = 0;
|
||||
let totalPages = 1;
|
||||
let pastesPerPage = 10;
|
||||
let userPastes = [];
|
||||
|
||||
@@ -63,7 +63,7 @@ function formatDate(date, minutes = false) {
|
||||
|
||||
async function fetchUserPastes() {
|
||||
try {
|
||||
const response = await fetch('/api/pastes/my?page=0&limit=15');
|
||||
const response = await fetch('/api/pastes/my?page=1&limit=15');
|
||||
const pastesData = await response.json();
|
||||
|
||||
if (pastesData.message === 'No pastes found.' || pastesData.message === 'Page out of range.') {
|
||||
|
||||
Reference in New Issue
Block a user