fix: open modrinth project links in the app (#6072)
This commit is contained in:
@@ -26,6 +26,23 @@ export class LabrinthProjectsV2Module extends AbstractModule {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that a project slug or ID exists and return its canonical project ID.
|
||||
*
|
||||
* @param idOrSlug - Project ID or slug (e.g. `sodium` or `AANobbMI`)
|
||||
*/
|
||||
public async check(idOrSlug: string): Promise<Labrinth.Projects.v2.ProjectCheckResponse> {
|
||||
const encoded = encodeURIComponent(idOrSlug)
|
||||
return this.client.request<Labrinth.Projects.v2.ProjectCheckResponse>(
|
||||
`/project/${encoded}/check`,
|
||||
{
|
||||
api: 'labrinth',
|
||||
version: 2,
|
||||
method: 'GET',
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get multiple projects by IDs
|
||||
*
|
||||
|
||||
@@ -468,6 +468,10 @@ export namespace Labrinth {
|
||||
monetization_status: MonetizationStatus
|
||||
}
|
||||
|
||||
export type ProjectCheckResponse = {
|
||||
id: string
|
||||
}
|
||||
|
||||
export type SearchResultHit = {
|
||||
project_id: string
|
||||
project_type: ProjectType
|
||||
|
||||
Reference in New Issue
Block a user