WakHerv7 / Test_API_Ecommerce_Agence_Digitale

Test API Ecommerce Agence Digitale
1 stars 0 forks source link

Link of an image #1

Open BrightkyEfoo opened 6 months ago

BrightkyEfoo commented 6 months ago

How to get the link of an image after creating a product? I get the name but I don't know wich link or url should i use to render it in a html image element

WakHerv7 commented 6 months ago

Sorry, I should have mentioned this:

I saved images in differents folders:

To get product thumbnails: /uploads/thumbnailsProduits/[filename] Example: http://localhost:3333/uploads/thumbnailsProduits/clv8fqfke00058cjjbxggh0lr.png

To get product image: /uploads/imagesProduits/[filename] Example: http://localhost:3333/uploads/imagesProduits/clv8fqfku00078cjjfv190ysh.png

To get category image: /uploads/categories/[filename] Example: http://localhost:3333/uploads/categories/clv8efig40001v5jj4mqx56wa.jpg

Actually, I should've added the file path instead of the file name.

BrightkyEfoo commented 6 months ago

Yes providing the file path is better for the API consumer. It make sense to have directly a link, 'Cause at any time for any reason you can be call to change the location of your API, I mean a differnt ip, a different port or just a different domain name.

BrightkyEfoo commented 6 months ago

But I notice that every user can add and remove any product, Is it a good way ?

WakHerv7 commented 6 months ago

I didn't realize it back then, since I tested it with only one user. No it's not a good way. It depends :

BrightkyEfoo commented 6 months ago

It means you have to introduce lot of new thinks, I mean this is a kind of RBAC

WakHerv7 commented 6 months ago

Yes it is. But the test didn't mention anything like that. That's why I didn't do it.

BrightkyEfoo commented 6 months ago

Hummm, ok ok. it will be nice If we can work one day on a project together, Pleas' can i have your email address ?

WakHerv7 commented 6 months ago

wakam.hermann@gmail.com

Are you the examinator or what ?

BrightkyEfoo commented 6 months ago

I'm a competitor

BrightkyEfoo commented 6 months ago

Yo didn't notice?

WakHerv7 commented 6 months ago

Why are you asking me all those questions ? Do you want to understand my work to better your own ? It's not fair.

BrightkyEfoo commented 6 months ago

image I already submit my work since two days bro, don't worry. I'm not here to cheat on you.

BrightkyEfoo commented 6 months ago

Don't worry, chill chill

WakHerv7 commented 6 months ago

Okay. Did you use Adonis too ?

BrightkyEfoo commented 6 months ago

Why are you asking me all those questions ? Do you want to understand my work to better your own ? It's not fair.

I'm asking you all those, like, I want understand. I'm in love with your code, I love when things they good. Nothing more!

BrightkyEfoo commented 6 months ago

Okay. Did you use Adonis too ?

Nope, actually I'm learning adonisJS. You see why I'm so interested by your code, right ?

WakHerv7 commented 6 months ago

I see you did backend and frontend.

I learned AdonisJs in 02 days, to be able to do the test. Initially i applied for frontend, but the test was for backend so I adapted. I already know some backend (Laravel, Django). AdonisJs is very similar to Laravel. That's why I did it.

I thought the deadline was last sunday. That's why I didn't do any frontend.

BrightkyEfoo commented 6 months ago

Yes I did them two. No the deadline is this sunday. Is it really possible to do it in 3 days ?

WakHerv7 commented 6 months ago

It's possible with AdonisJS.

BrightkyEfoo commented 6 months ago

Humm, Humm, you did it

BrightkyEfoo commented 6 months ago

Ok see you, I have a lot of work now... I will mail you later

WakHerv7 commented 6 months ago

Ok, me too.