Please enable JavaScript.
Coggle requires JavaScript to display documents.
▶️ Check Reviews (check (%messages=null ($ %apps each(%app) (exit…
▶️ Check Reviews
check
%messages=null
$ %apps each(%app)
next
%break=null
%latestReviewId=null
%lastCheckedReviewId=$.lastCheckedReviewId %app
%package=$.package %app
$SYS.GET
3 more items...
exit
?messages
$SYS.CARDS %messages
%review=null
%review=$[
?(@.innerReviewId
=="%id")] %reviewIds
else
1 more item...
?review
6 more items...
else
end
go
?messages
add
?reviewIds
anchor
calc
%reviewIdSlice=mb_substr("%reviewId",-8)
%innerReviewId=%sys.timestamp%reviewIdSlice
%innerReviewObj={"innerReviewId":"%innerReviewId","reviewId":"%reviewId","author":"%author","package":"%package"}
$ %reviewIds add(%innerReviewObj)
%message={"title":"%rating %author %flag","buttons":[{"text":"reply","reply_payload":{"id":"%innerReviewId"}}]}
1 more item...
else
%reviewIds=[]
#
else
%messages={"items":[]}
#