schon/storefront/app/composables/posts/usePosts.ts
Alexandr SaVBaD Waltz e65e7b7d73 **chore(storefront): apply consistent code formatting and improve readability**
Refactored multiple files for code styling consistency, using proper indentation and spacing to align with team standards. Improved readability and maintainability across composables, Apollo plugin, and localization files.

Enhancements:
- Standardized import and function indentation across all composables.
- Updated `biome.json` schema to the latest version (v2.4.4) for tool compatibility.
- Organized code blocks in Apollo plugin for better understandability.

No functional changes introduced—this is a non-breaking, code refinement commit.
2026-02-28 17:41:25 +03:00

18 lines
382 B
TypeScript

import { GET_POSTS } from '@graphql/queries/standalone/blog';
import type { IPostResponse } from '@types';
export function usePosts() {
const { data, error } = useAsyncQuery<IPostResponse>(GET_POSTS);
const posts = computed(() => data.value?.posts.edges ?? []);
watch(error, (err) => {
if (err) {
console.error('usePosts error:', err);
}
});
return {
posts,
};
}