Skip to content

Commit e0f6e28

Browse files
authored
Merge pull request #12 from secultce/develop
🚀 Alterando url da Api
2 parents be87609 + 69dd2d4 commit e0f6e28

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/helpers/helpers.js

+5-15
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ async function getNoticeOpen()
55
{
66
const codeAgent = import.meta.env.VITE_ID_AGENTS_SECULT
77
const urlMata = import.meta.env.VITE_API_MAPA_URL
8-
9-
// console.log(codeAgent)
108
const dataNoticeOpen = [];
11-
const period = `${'registrationFrom=LTE(2024-01-01)&registrationTo=GTE('+moment().format('YYYY-MM-DD')+')'}`;
12-
const field = '@select=id,singleUrl,name,subTitle,type,shortDescription,terms';
9+
const period = `${'registrationFrom=GTE(2024-01-01)&registrationTo=LTE('+moment().format('YYYY-MM-DD')+')'}`;
10+
const field = '@select=id,singleUrl,name,subTitle,type,shortDescription,terms,publishedRegistrations,publish_site,registrationFrom,createTimestamp,registrationTo';
1311

14-
const dataF = await fetch(urlMata + 'api/opportunity/find/?&'+period+'&@order=createTimestamp%20DESC&'+field+'&@files=(avatar.avatarBig):url&@page=1&status=eq(1)&owner=IN('+codeAgent+')')
12+
const dataF = await fetch(urlMata + 'api/opportunity/find/?&'+period+'&@order=createTimestamp DESC&'
13+
+field+'&@files=(avatar.avatarBig):url&@page=1&status=eq(1)&owner=IN('+codeAgent+')&publish_site=NULL()&publishedRegistrations=EQ(false)')
1514
.then(res => {
1615
return res.json()
1716
})
@@ -30,16 +29,7 @@ async function getNoticeOpen()
3029

3130
async function getNoticeClosed()
3231
{
33-
// const year = moment().format("YYYY")+'-01-01,'+moment().format("YYYY")+'-12-31' //ano inteiro, variando somente o ano
34-
// const period = `${'registrationTo=LTE(2023-01-01)'}` //menor que a data do dia
35-
// const field = '@select=id,singleUrl,name,publishedRegistrations,shortDescription' //campos que deseja pelo api
36-
// const codeAgent = import.meta.env.VITE_ID_AGENTS_SECULT //Agentes dono das oportunidades
37-
// const dataClosed = await fetch(
38-
// import.meta.env.VITE_API_MAPA_URL +
39-
// 'api/opportunity/find/?'+
40-
// period + '&@order=createTimestamp%20DESC&'+
41-
// field + '&@files=(avatar.avatarBig):url,description&@page=1&registrationFrom=BET('+year+')&owner=IN('+codeAgent+')&publishedRegistrations=EQ(true)'
42-
// )
32+
4333
const year = '2023-01-01,'+moment().format("YYYY")+'-12-31' //ano inteiro, variando somente o ano
4434
const period = `${'registrationTo=LT('+moment().format('YYYY-MM-DD')+')'}`;
4535
const field = '@select=id,singleUrl,name,shortDescription,publishedRegistrations,publish_site' //campos que deseja pelo api

0 commit comments

Comments
 (0)