blob: 92c60943f36702da45c5a8b07230b3758bf847c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import { IPromotionProgram } from '~/types/promotionProgram';
export const getPromotionProgram = async (
programId: number
): Promise<{ data: IPromotionProgram }> => {
const url = `/api/promotion-program/${programId}`;
return await fetch(url).then((res) => res.json());
};
export const getPromotionProgramSolr = async () => {
console.log(`/solr/promotion-program/select?q=*:*`)
const response = await fetch(`/solr/promotion_programs/select?indent=true&q.op=OR&q=*:*&fq=banner_s:[* TO *]`);
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
};
|