@lenne.tech/nest-server 9.0.4 → 9.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nest-server",
3
- "version": "9.0.4",
3
+ "version": "9.0.7",
4
4
  "description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
5
5
  "keywords": [
6
6
  "node",
package/src/config.env.ts CHANGED
@@ -54,7 +54,7 @@ const config: { [env: string]: IServerOptions } = {
54
54
  },
55
55
  loadLocalConfig: false,
56
56
  mongoose: {
57
- uri: 'mongodb://localhost/nest-server-dev',
57
+ uri: 'mongodb://127.0.0.1/nest-server-dev',
58
58
  },
59
59
  port: 3000,
60
60
  sha256: true,
@@ -106,7 +106,7 @@ const config: { [env: string]: IServerOptions } = {
106
106
  },
107
107
  loadLocalConfig: false,
108
108
  mongoose: {
109
- uri: 'mongodb://localhost/nest-server-dev',
109
+ uri: 'mongodb://127.0.0.1/nest-server-dev',
110
110
  },
111
111
  port: 3000,
112
112
  sha256: true,
@@ -158,7 +158,7 @@ const config: { [env: string]: IServerOptions } = {
158
158
  },
159
159
  loadLocalConfig: false,
160
160
  mongoose: {
161
- uri: 'mongodb://localhost/nest-server-prod',
161
+ uri: 'mongodb://127.0.0.1/nest-server-prod',
162
162
  },
163
163
  port: 3000,
164
164
  sha256: true,
@@ -1,6 +1,7 @@
1
1
  import { Injectable } from '@nestjs/common';
2
2
  import { ConfigService } from './config.service';
3
- import Mailjet from 'node-mailjet';
3
+ // eslint-disable-next-line
4
+ const Mailjet = require('node-mailjet');
4
5
 
5
6
  /**
6
7
  * Mailjet service
@@ -156,11 +156,17 @@ export abstract class CoreUserService<
156
156
  if (!dbObject) {
157
157
  throw new NotFoundException(`No user found with email: ${email}`);
158
158
  }
159
+
159
160
  return this.process(
160
161
  async () => {
161
162
  // Set reset token and return
162
163
  dbObject.passwordResetToken = crypto.randomBytes(32).toString('hex');
163
- return await dbObject.save();
164
+
165
+ // Save
166
+ await dbObject.save();
167
+
168
+ // Return new user
169
+ return dbObject;
164
170
  },
165
171
  { dbObject, serviceOptions }
166
172
  );
@@ -1,4 +1,5 @@
1
1
  import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
2
+ import * as fs from 'fs';
2
3
  import { createWriteStream } from 'fs';
3
4
  import * as GraphQLUpload from 'graphql-upload/GraphQLUpload.js';
4
5
  import { Roles } from '../../../core/common/decorators/roles.decorator';
@@ -63,6 +64,7 @@ export class FileResolver {
63
64
  const promises: Promise<any>[] = [];
64
65
  for (const file of files) {
65
66
  const { filename, mimetype, encoding, createReadStream } = await file;
67
+ await fs.promises.mkdir('./uploads', { recursive: true });
66
68
  promises.push(
67
69
  new Promise((resolve, reject) =>
68
70
  createReadStream()