fix typescript types

This commit is contained in:
imperosol 2025-03-07 17:56:08 +01:00
parent 0f6cda377c
commit 04c7df8ac8
4 changed files with 8 additions and 15 deletions

View File

@ -56,7 +56,6 @@ export const paginated = async <T>(
interface Request extends TDataShape {
client?: Client;
url: string;
}
interface InterceptorOptions {

View File

@ -108,7 +108,7 @@ document.addEventListener("alpine:init", () => {
* Build the object containing the query parameters corresponding
* to the current filters
*/
getQueryParams(): ProductSearchProductsDetailedData {
getQueryParams(): Omit<ProductSearchProductsDetailedData, "url"> {
const search = this.search.length > 0 ? this.search : null;
// If active or archived products must be filtered, put the filter in the request
// Else, don't include the filter

View File

@ -24,7 +24,6 @@ document.addEventListener("alpine:init", () => {
page: Number.parseInt(initialUrlParams.get("page")) || 1,
pushstate: History.Push /* Used to avoid pushing a state on a back action */,
loading: false,
config: config,
async init() {
await this.fetchPictures();
@ -51,11 +50,9 @@ document.addEventListener("alpine:init", () => {
async fetchPictures() {
this.loading = true;
this.pictures = await paginated(picturesFetchPictures, {
query: {
// biome-ignore lint/style/useNamingConvention: API is in snake_case
album_id: config.albumId,
} as PicturesFetchPicturesData["query"],
});
// biome-ignore lint/style/useNamingConvention: API is in snake_case
query: { album_id: config.albumId },
} as PicturesFetchPicturesData);
this.loading = false;
},
@ -66,7 +63,6 @@ document.addEventListener("alpine:init", () => {
Alpine.data("albums", (config: SubAlbumsConfig) => ({
albums: [] as AlbumSchema[],
config: config,
loading: false,
async init() {
@ -77,7 +73,7 @@ document.addEventListener("alpine:init", () => {
this.loading = true;
this.albums = await paginated(albumFetchAlbum, {
// biome-ignore lint/style/useNamingConvention: API is snake_case
query: { parent_id: this.config.parentId },
query: { parent_id: config.parentId },
} as AlbumFetchAlbumData);
this.loading = false;
},

View File

@ -17,11 +17,9 @@ document.addEventListener("alpine:init", () => {
async init() {
this.pictures = await paginated(picturesFetchPictures, {
query: {
// biome-ignore lint/style/useNamingConvention: from python api
users_identified: [config.userId],
} as PicturesFetchPicturesData["query"],
});
// biome-ignore lint/style/useNamingConvention: from python api
query: { users_identified: [config.userId] },
} as PicturesFetchPicturesData);
this.albums = this.pictures.reduce(
(acc: Record<string, PictureSchema[]>, picture: PictureSchema) => {