Co-authored-by: AiraNadih <AiraNadih@users.noreply.github.com>
This commit is contained in:
@@ -53,7 +53,7 @@ async function handler(ctx) {
|
||||
|
||||
const rootUrl = 'https://coomer.st';
|
||||
const apiUrl = `${rootUrl}/api/v1`;
|
||||
const currentUrl = isPosts ? `${apiUrl}/posts` : `${apiUrl}/${source}/user/${id}`;
|
||||
const currentUrl = isPosts ? `${apiUrl}/posts` : `${apiUrl}/${source}/user/${id}/posts`;
|
||||
|
||||
const headers = {
|
||||
cookie: '__ddg2=sBQ4uaaGecmfEUk7',
|
||||
@@ -66,7 +66,7 @@ async function handler(ctx) {
|
||||
});
|
||||
const responseData = isPosts ? response.data.posts : response.data;
|
||||
|
||||
const author = isPosts ? '' : await getAuthor(currentUrl, headers);
|
||||
const author = isPosts ? '' : await getAuthor(`${apiUrl}/${source}/user/${id}`, headers);
|
||||
const title = isPosts ? 'Coomer Posts' : `Posts of ${author} from ${source} | Coomer`;
|
||||
const image = isPosts ? `${rootUrl}/favicon.ico` : `https://img.coomer.st/icons/${source}/${id}`;
|
||||
const items = responseData
|
||||
|
||||
@@ -94,7 +94,7 @@ function buildApiUrl(source: string, userId?: string, contentType?: string): str
|
||||
}
|
||||
|
||||
const basePath = `${KEMONO_API_URL}/${source}/user/${userId}`;
|
||||
return contentType ? `${basePath}/${contentType}` : basePath;
|
||||
return contentType ? `${basePath}/${contentType}` : `${basePath}/posts`;
|
||||
}
|
||||
|
||||
function buildFrontendUrl(source: string, userId?: string, contentType?: string): string {
|
||||
|
||||
Reference in New Issue
Block a user