How to get enums in prisma client?

You can access the user_type enum in your application code like this: import {user_type } from “@prisma/client”; let foo: user_type = “superadmin”; // use like any other type/enum How you plan to connect this to the client-side or send it there is up to you. Typically Prisma types reside in the server-side of your code, … Read more

How to add mixins to ES6 javascript classes?

Javascript’s object/property system is much more dynamic than most languages, so it’s very easy to add functionality to an object. As functions are first-class objects, they can be added to an object in exactly the same way. Object.assign is the way to add the properties of one object to another object. (Its behaviour is in … Read more

Parsing error: No Babel config file detected

I had the same issue and this change fixed the issue. In your .eslintrc.js file, add requireConfigFile: false parserOptions: { parser: ‘@babel/eslint-parser’, requireConfigFile: false, // <== ADD THIS ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features sourceType: ‘module’ // Allows for the use of imports }

NestJs: Unable to read env variables in module files but able in service files?

Your .env file is not yet read in when your JwtModule is instantiated. So either read it in earlier e.g. in your main.ts before the nest app is created or better: create a ConfigService and make the dependency on your config explicit: JwtModule.registerAsync({ imports: [ConfigModule], useFactory: async (configService: ConfigService) => ({ secret: configService.jwtSecret, }), inject: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)