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:
whoswhip
2025-07-08 15:32:17 -04:00
parent 181c401af7
commit ed98238c40
6 changed files with 246 additions and 398 deletions
+2 -2
View File
@@ -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.') {