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 {
|
interface Request extends TDataShape {
|
||||||
client?: Client;
|
client?: Client;
|
||||||
url: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface InterceptorOptions {
|
interface InterceptorOptions {
|
||||||
|
@ -108,7 +108,7 @@ document.addEventListener("alpine:init", () => {
|
|||||||
* Build the object containing the query parameters corresponding
|
* Build the object containing the query parameters corresponding
|
||||||
* to the current filters
|
* to the current filters
|
||||||
*/
|
*/
|
||||||
getQueryParams(): ProductSearchProductsDetailedData {
|
getQueryParams(): Omit<ProductSearchProductsDetailedData, "url"> {
|
||||||
const search = this.search.length > 0 ? this.search : null;
|
const search = this.search.length > 0 ? this.search : null;
|
||||||
// If active or archived products must be filtered, put the filter in the request
|
// If active or archived products must be filtered, put the filter in the request
|
||||||
// Else, don't include the filter
|
// Else, don't include the filter
|
||||||
|
@ -51,11 +51,9 @@ document.addEventListener("alpine:init", () => {
|
|||||||
async fetchPictures() {
|
async fetchPictures() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.pictures = await paginated(picturesFetchPictures, {
|
this.pictures = await paginated(picturesFetchPictures, {
|
||||||
query: {
|
// biome-ignore lint/style/useNamingConvention: API is in snake_case
|
||||||
// biome-ignore lint/style/useNamingConvention: API is in snake_case
|
query: { album_id: config.albumId },
|
||||||
album_id: config.albumId,
|
} as PicturesFetchPicturesData);
|
||||||
} as PicturesFetchPicturesData["query"],
|
|
||||||
});
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -66,7 +64,6 @@ document.addEventListener("alpine:init", () => {
|
|||||||
|
|
||||||
Alpine.data("albums", (config: SubAlbumsConfig) => ({
|
Alpine.data("albums", (config: SubAlbumsConfig) => ({
|
||||||
albums: [] as AlbumSchema[],
|
albums: [] as AlbumSchema[],
|
||||||
config: config,
|
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
@ -77,7 +74,7 @@ document.addEventListener("alpine:init", () => {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.albums = await paginated(albumFetchAlbum, {
|
this.albums = await paginated(albumFetchAlbum, {
|
||||||
// biome-ignore lint/style/useNamingConvention: API is snake_case
|
// biome-ignore lint/style/useNamingConvention: API is snake_case
|
||||||
query: { parent_id: this.config.parentId },
|
query: { parent_id: config.parentId },
|
||||||
} as AlbumFetchAlbumData);
|
} as AlbumFetchAlbumData);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
@ -17,11 +17,9 @@ document.addEventListener("alpine:init", () => {
|
|||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
this.pictures = await paginated(picturesFetchPictures, {
|
this.pictures = await paginated(picturesFetchPictures, {
|
||||||
query: {
|
// biome-ignore lint/style/useNamingConvention: from python api
|
||||||
// biome-ignore lint/style/useNamingConvention: from python api
|
query: { users_identified: [config.userId] },
|
||||||
users_identified: [config.userId],
|
} as PicturesFetchPicturesData);
|
||||||
} as PicturesFetchPicturesData["query"],
|
|
||||||
});
|
|
||||||
|
|
||||||
this.albums = this.pictures.reduce(
|
this.albums = this.pictures.reduce(
|
||||||
(acc: Record<string, PictureSchema[]>, picture: PictureSchema) => {
|
(acc: Record<string, PictureSchema[]>, picture: PictureSchema) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user