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

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

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial discusses a problem with manipulating data inside a controller and proposes a cleaner solution by creating a custom service to fetch non-premium posts. The implementation involves creating a new async find method and a custom service that handles query objects. The tutorial emphasizes the benefits of this approach, such as cleaner controller code and efficient data processing. The solution is tested to ensure it returns the expected results, highlighting the importance of dedicated services in maintaining clean architecture.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main advantage of creating a custom service to fetch non-premium posts?

It reduces the need for authentication.

It allows for more complex queries.

It increases the speed of data retrieval.

It cleans up the controller's code.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the new async find method, what is the primary change compared to the previous implementation?

It adds more filters to the query.

It uses a different database.

It uses a custom service for logic execution.

It modifies the incoming query object.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the new custom service do with the query object?

It deletes unnecessary fields.

It logs the query for debugging.

It adds a filter for non-premium posts.

It encrypts the query for security.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does the custom service interact with the entity service?

It uses a different API endpoint.

It bypasses the entity service.

It sends a modified query object.

It sends the original query object.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the final step after the custom service returns data?

The data is directly sent to the client.

The data is stored in a database.

The controller shapes the data for the client.

The data is discarded if not needed.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is the new solution considered the cleanest?

It is faster than previous solutions.

It requires no additional services.

It separates data processing from the controller.

It uses fewer lines of code.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the role of the controller in the new solution?

To directly interact with the database.

To call the custom service and shape the response.

To handle authentication only.

To perform all data processing.