mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: typings for attributeList store
This commit is contained in:
1 parent
d406930742
commit
25d205d0af
1 file changed
+14
-3
+14
-3
@@ -96,16 +96,27 @@ export const indexList = cachedStore<
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* TODO: Mock proper types until the SKD is fixed.
|
||||
*/
|
||||
export type AttributeResponse = Omit<Models.AttributeList, 'attributes'> & {
|
||||
attributes: Attributes[];
|
||||
};
|
||||
|
||||
export const attributeList = cachedStore<
|
||||
Models.AttributeList,
|
||||
AttributeResponse,
|
||||
{
|
||||
load: (databaseId: string, collectionId: string) => Promise<void>;
|
||||
}
|
||||
>('attributeList', function ({ set }) {
|
||||
return {
|
||||
load: async (databaseId, collectionId) => {
|
||||
const response = await sdkForProject.databases.listAttributes(databaseId, collectionId);
|
||||
set(response);
|
||||
const response: unknown = await sdkForProject.databases.listAttributes(
|
||||
databaseId,
|
||||
collectionId
|
||||
);
|
||||
|
||||
set(response as AttributeResponse);
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in new issue
Block a user