260322:1648 Correct Coresspondence / Doing RFA / Correct CI
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s

This commit is contained in:
admin
2026-03-22 16:48:12 +07:00
parent e5deedb42e
commit 11984bfa29
683 changed files with 105251 additions and 29068 deletions
+8 -8
View File
@@ -1,6 +1,6 @@
// File: lib/services/search.service.ts
import apiClient from "@/lib/api/client";
import { SearchQueryDto } from "@/types/dto/search/search-query.dto";
import apiClient from '@/lib/api/client';
import { SearchQueryDto } from '@/types/dto/search/search-query.dto';
export const searchService = {
/**
@@ -10,8 +10,8 @@ export const searchService = {
search: async (query: SearchQueryDto) => {
// ส่ง params แบบ flat ตาม DTO
// GET /search?q=...&type=...&projectId=...
const response = await apiClient.get("/search", {
params: query
const response = await apiClient.get('/search', {
params: query,
});
return response.data;
},
@@ -21,8 +21,8 @@ export const searchService = {
* ใช้ search endpoint แต่จำกัดจำนวน
*/
suggest: async (query: string) => {
const response = await apiClient.get("/search", {
params: { q: query, limit: 5 }
const response = await apiClient.get('/search', {
params: { q: query, limit: 5 },
});
// Assuming backend returns { items: [], ... } or just []
return response.data.items || response.data;
@@ -32,7 +32,7 @@ export const searchService = {
* (Optional) Re-index ข้อมูลใหม่ กรณีข้อมูลไม่ตรง (Admin Only)
*/
reindex: async (type?: string) => {
const response = await apiClient.post("/search/reindex", { type });
const response = await apiClient.post('/search/reindex', { type });
return response.data;
}
},
};