vevcom / projectNext

Project Next is Omegas new website coming soon
MIT License
8 stars 0 forks source link

Feat/article-3-collections-and-news #182

Closed JohanHjelsethStorstad closed 8 months ago

JohanHjelsethStorstad commented 8 months ago

This PR creates

changes:

JohanHjelsethStorstad commented 8 months ago

This PR also fixes an issue with building prismaservice I think

Paulijuz commented 8 months ago

Since i was the last one to push someone else will have to merge. @JohanHjelsethStorstad

Another wierd prisma error occured during the build job for this PR, i also got the same error on my machine. However, the wierd thing is that the build didn't fail. Building a second time on my machnie also cleared it.

Paulijuz commented 8 months ago

This looks like the interesting part.

#32 40.85 Invalid `prisma.articleCategory.findMany()` invocation:
#32 40.85 
#32 40.85 
#32 40.85 error: Environment variable not found: DB_URI.
#32 40.85   -->  schema.prisma:16
#32 40.85    | 
#32 40.85 15 |   provider = "postgresql"
#32 40.85 16 |   url      = env("DB_URI")
#32 40.85    | 
#32 40.85 

It appears that during the build prisma tries to connect to the db, but it fails since a DB_URI is not set during build...

JohanHjelsethStorstad commented 8 months ago

I need someone else to look over it all @theodorklauritzen, @AndreasVJ.

theodorklauritzen commented 8 months ago

Things look pretty nice, but I noticed a few weird things.

JohanHjelsethStorstad commented 8 months ago

Things look pretty nice, but I noticed a few weird things.

  • Since names cannot be duplicated on news, they will probably be long. Therefore, the character limit of 20 is too small. Another option is to include the publishing year or date in the URL and then allow equal names on news articles.
  • When editing news, the title and name fields should sync. Or the name field should not be there.

I have fixed unique name: now: a news article has @@unique([articleName, orderPublished]) and an article in a article category must be the only article with that name in the category