I’m done! I’m finally done with all the screens. I can’t believe I managed to complete my task before my internship ends and can have my Raya holidays with peace. Haha.

As I mentioned in my last two previous posts, I’m struggling to get data of the last performance. At first, I thought to get last performance I should do it refresh function. It was totally wrong because it’s not related at all. Opss. I should get the data in ask function. The last performance judged is determined from the stamp field of the scores created by a judge for a particular event.

axios.get(‘/scores’, {

params:{

_start: 0,

_end:1,

judgingId:this.judging.id,

_sort: ‘stamp’,

_order: ‘DESC’

}).then(r => {

if (r.data.length == 1) {

axios.get(‘/performances/’ + r.data[0].performanceId)

.then (r => {

this.lastPerformance = r.data;

}).catch(function (e) {

console.error(e);

});

} })

},

 

As you can see the source code above, from the GET score with parameter  ” _end:1″, I checked it whether it’s an empty array or not. Next, I will get the last performance data from the performance id in GET performance and stored the data in r.data.

There was a new intern coming on Monday. I had to explain to him about the project I’m working on because I will have a long holiday till next week. He will help me to set up the server and router during the competition.  I guess that’s all for this week. Next week blog will be interesting one because the competition is on Sunday hehe! I can’t wait to share my experience with you guys. Before I end my blog, I want to wish Happy Eid Mubarak to those who celebrate it.


0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.