Skip to content

Commit

Permalink
fix schema prisma.
Browse files Browse the repository at this point in the history
  • Loading branch information
tharlestsa committed Sep 29, 2024
1 parent 47afcf3 commit 04e8d39
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11,282 deletions.
14 changes: 7 additions & 7 deletions src/server/middleware/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ module.exports = function(app) {
Repository.client = MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true });

Repository.init = function(callback) {
Repository.prisma = new PrismaClient(config.prismaOpts);
Repository.client.connect((err, client) => {
Repository.prisma = new PrismaClient();
Repository.client.connect((err, client) => {
if (err) {
return callback(err);
}
Expand All @@ -32,10 +32,10 @@ module.exports = function(app) {
}
const forEachOne = function(collection, callback) {
const name = collection.name.substr(collection.name.indexOf('\.') + 1);
if(name != 'indexes') {
if (name != 'indexes') {
Repository.db.collection(name, function(err, repository) {
if(err){
console.log(err)
if (err) {
console.log(err);
}
Repository.collections[name] = repository;
callback();
Expand All @@ -44,9 +44,9 @@ module.exports = function(app) {
callback();
}
};
async.each(collection, forEachOne, callback)
async.each(collection, forEachOne, callback);
});
})
});
};

Repository.getSync = function(collectionName) {
Expand Down
Loading

0 comments on commit 04e8d39

Please sign in to comment.