@@ -5,13 +5,12 @@ async function getNoticeOpen()
5
5
{
6
6
const codeAgent = import . meta. env . VITE_ID_AGENTS_SECULT
7
7
const urlMata = import . meta. env . VITE_API_MAPA_URL
8
-
9
- // console.log(codeAgent)
10
8
const dataNoticeOpen = [ ] ;
11
- const period = `${ 'registrationFrom=LTE (2024-01-01)®istrationTo=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)®istrationTo=LTE (' + moment ( ) . format ( 'YYYY-MM-DD' ) + ')' } ` ;
10
+ const field = '@select=id,singleUrl,name,subTitle,type,shortDescription,terms,publishedRegistrations,publish_site,registrationFrom,createTimestamp,registrationTo ' ;
13
11
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)' )
15
14
. then ( res => {
16
15
return res . json ( )
17
16
} )
@@ -30,16 +29,7 @@ async function getNoticeOpen()
30
29
31
30
async function getNoticeClosed ( )
32
31
{
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®istrationFrom=BET('+year+')&owner=IN('+codeAgent+')&publishedRegistrations=EQ(true)'
42
- // )
32
+
43
33
const year = '2023-01-01,' + moment ( ) . format ( "YYYY" ) + '-12-31' //ano inteiro, variando somente o ano
44
34
const period = `${ 'registrationTo=LT(' + moment ( ) . format ( 'YYYY-MM-DD' ) + ')' } ` ;
45
35
const field = '@select=id,singleUrl,name,shortDescription,publishedRegistrations,publish_site' //campos que deseja pelo api
0 commit comments