mirror of
https://github.com/expo/appjs25-eas-update-workshop-code.git
synced 2026-11-14 17:48:09 -10:00
16 lines
398 B
TypeScript
16 lines
398 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
|
|
const data = require("../api/cma_artwork.json");
|
|
|
|
export const useWorksForDepartmentQuery = function (department: string) {
|
|
// Queries
|
|
const query = useQuery({
|
|
queryKey: [`departments:${department}`],
|
|
queryFn: async () => {
|
|
return data.data.filter((item: any) => item.department === department);
|
|
},
|
|
});
|
|
|
|
return query;
|
|
};
|