Recent Activity
Here's what @cgregoire has been up to this past year
-
Replied to Ah - I see what you mean now, thank you! Unfortunately, being...
Yes that's it ! I was close to this approach, but I can't use the variant with the fromArray / fromPaginator, I had types issues too
for example :
this.borrowers = UserDto.fromArray(organization.borrowers) => this will generate borrowers with all fields including password etc…
An other question : Could we make the class UserPresenter extends UserDto ? Does it makes sens ? It could keep all variations in the presenter with the access to all user properties without creating many methods in the dto ?
I m not familiar with POO so, I try to understand why every methods are static too
Your answer was helpfull !
-
Upvoted comment Ah - I see what you mean now, thank you! Unfortunately, being...
-
Replied to Thanks for the reply, sorry I wasn't clear enought I can explain...
What I wanted to explain :
-
Replied to Hi cgregoire! Not sure I fully follow what you're after, but...
Thanks for the reply, sorry I wasn't clear enought
I can explain a bit here about what I am looking for :No mater if the password is set or not, I wanted to hide it, because in most of case I fetch users and some of their informations. I followed the steps about the serialization / DTOs but there is another issue :
In my project I tried to find a way to display only specific fields according to the case, I mean, sometimes a rest endpoint provides too much informations in the payload than needed,The dtos seems to be be the go to for, but, it multiply the "variant" of a DTO for example : UserPublic, UserPrivate, UserWithPassword, etc (that s just example but not exactly my solution for now), there is another issue when I have to use fromArray, or fromPaginator, I couldn't use my "dto variant" with this methods
Another way I am trying now is to use Graphql to limit the fields returned by the api, with a hybrid setup = Rest API + graphql server side using lucid to request database.
I hope it will be clearer, thanks a lot for the knowledge you share, it helps a lot !
-
Commented on post Typing Lucid Models in Inertia with DTOs
Could you suggest a good way to manage hidden fields like user password in dtos ? I tried to add properties like « WithPassword » in my dto user class, but i m not sur about it
-
Completed lesson Forgot Password & Password Reset
-
Completed lesson Rolling Our Own Authorization Access Controls
-
Completed lesson Introducing, Installing, & Configuring Bouncer
-
Completed lesson Editing & Updating Courses
-
Completed lesson Creating A New Course
-
Completed lesson Creating & Listing Sortable Course Lessons
-
Completed lesson Creating, Editing, & Deleting Course Modules
-
Completed lesson Adding A Publish Date & Time Input
-
Completed lesson How To Configure & Use Multiple Authentication Guards
-
Completed lesson Inspecting Lucid Queries for Index Analysis
-
Completed lesson Making our Search Course Action Easily Reusable
-
Completed lesson Advanced String Filtering
-
Completed lesson Paginating our Course List
-
Completed lesson Searching and Filtering Lessons
-
Completed lesson Filtering Lessons by Publication Date
-
Completed lesson Alerting Users When Their Account Email Is Changed
-
Completed lesson What Code Can & Can't Be Shared Between AdonisJS & Inertia
-
Completed lesson Specifying Page Titles & Meta Tags
-
Completed lesson Default Layouts & Overwriting the Default Layout
-
Completed lesson Seeding Fake Data to Index for our Multi-Search
-
Completed lesson Creating our Database Migrations, Models, and Factories
-
Completed lesson Setting Up TailwindCSS, Shadcn-Vue, and Automatic Component Imports
-
Completed lesson What Is InertiaJS?
-
Completed lesson Specifying Page Titles & Meta Tags
-
Completed lesson Partial and Lazy Data Loading and Evaluation
-
Completed lesson Partial and Lazy Data Loading and Evaluation
-
Completed lesson Global Components and Hydration Mismatch in Action
-
Completed lesson The Link Component and Programmatic Linking
-
Completed lesson Linking Between Pages & Page State Flow
-
Completed lesson Sharing Data from AdonisJS to Vue via Inertia
-
Completed lesson What Are Some of Inertia's Limitations
-
Completed lesson The Flow of Pages and Page Props
-
Completed lesson Server-Side Rendering (SSR) vs Client-Side Rendering (CSR)
-
Completed lesson Server-Side Rendering (SSR) vs Client-Side Rendering (CSR)
-
Completed lesson Creating Our AdonisJS App With InertiaJS
-
Completed lesson What We'll Be Building
-
Completed lesson Querying & Listing Sortable Course Modules
-
Completed lesson Setting & Loading the User's Active Organization
-
Completed lesson Typing Lucid Models in Inertia with DTOs
-
Completed lesson Seeding Our Initial Database Data
-
Completed lesson Creating A Lucid Model Mixin for our Organization Relationship
-
Completed lesson Understanding Our Database Schema
-
Completed lesson Defining Our Lucid Models & Relationships
-
Completed lesson Defining Our Migrations & Foreign Keys
-
Completed lesson Defining Our Lucid Models & Relationships
-
Completed lesson Cross-Site Request Forgery (CSRF) Protection in InertiaJS
-
Completed lesson Onboarding Newly Registered Users
-
Completed lesson Logging Out Users
-
Completed lesson Common useForm Methods & Options
-
Completed lesson Splitting Our Routes Between Auth & Web
-
Completed lesson User Registration with InertiaJS
-
Completed lesson Form Validation & Displaying Errors
-
Completed lesson The useForm Helper
-
Completed lesson Inertia Form Basics
-
Account created Welcome to Adocasts, @cgregoire!