mirror of
https://github.com/ae-utbm/sith.git
synced 2025-03-09 23:07:11 +00:00
fix typescript types
This commit is contained in:
parent
58b7566e8f
commit
ed71ba09ba
@ -56,7 +56,6 @@ export const paginated = async <T>(
|
||||
|
||||
interface Request extends TDataShape {
|
||||
client?: Client;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface InterceptorOptions {
|
||||
|
@ -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
|
||||
|
@ -51,11 +51,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"],
|
||||
});
|
||||
query: { album_id: config.albumId },
|
||||
} as PicturesFetchPicturesData);
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
@ -66,7 +64,6 @@ document.addEventListener("alpine:init", () => {
|
||||
|
||||
Alpine.data("albums", (config: SubAlbumsConfig) => ({
|
||||
albums: [] as AlbumSchema[],
|
||||
config: config,
|
||||
loading: false,
|
||||
|
||||
async init() {
|
||||
@ -77,7 +74,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;
|
||||
},
|
||||
|
@ -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"],
|
||||
});
|
||||
query: { users_identified: [config.userId] },
|
||||
} as PicturesFetchPicturesData);
|
||||
|
||||
this.albums = this.pictures.reduce(
|
||||
(acc: Record<string, PictureSchema[]>, picture: PictureSchema) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user