The Complete Strapi™ Course with Plugins and Deployment - Premium Posts: Solution 2

The Complete Strapi™ Course with Plugins and Deployment - Premium Posts: Solution 2

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Wayground Content

FREE Resource

The video tutorial addresses two main issues in a current implementation: fetching unnecessary data and overloading the controller with tasks. A new solution is proposed, focusing on optimizing data fetching by rewriting the find action. The implementation involves reusing existing services with modifications, handling authenticated and public requests differently, and ensuring proper sanitization and transformation of data. Testing and debugging are conducted to ensure functionality, and edge cases are addressed. Final adjustments are made to improve the solution further.

Read more

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is one of the main issues identified with the current implementation?

Using too many services

Fetching unnecessary data

Controller doing too little work

Fetching only necessary data

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the proposed solution to address the issue of fetching unnecessary data?

Rewriting the find action

Adding more services

Ignoring the issue

Extending existing functionality

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does the rewritten find action handle authenticated requests?

By fetching all data

By creating new services

By reusing existing functionalities

By ignoring them

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What additional parameter is added to filter non-premium posts?

type equals public

status equals active

premium equals false

premium equals true

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is it important to handle cases where the client explicitly requests non-premium articles?

To simplify the code

To increase data fetching

To avoid unnecessary filtering

To reduce server load

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What should be checked before accessing the premium key in the query?

If the request is public

If the filters object exists

If the query is authenticated

If the user is logged in

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the consequence of replacing the query parameters altogether?

Simplified code

Loss of existing query filters

Increased data accuracy

Improved performance

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?