mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 15:03:07 +00:00
use NanoId as function in Mongoose default
For some reason, Mongoose will reuse the old ID generated if you call nanoid directly. If you wrap it in a function, it will call it new each time a new document is created. Also updated patreon link :)
This commit is contained in:
@@ -6,7 +6,7 @@ module.exports = function(props){
|
|||||||
return <Nav.item
|
return <Nav.item
|
||||||
className='patreon'
|
className='patreon'
|
||||||
newTab={true}
|
newTab={true}
|
||||||
href='https://www.patreon.com/stolksdorf'
|
href='https://www.patreon.com/NaturalCrit'
|
||||||
color='green'
|
color='green'
|
||||||
icon='fa-heart'>
|
icon='fa-heart'>
|
||||||
help out
|
help out
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ const _ = require('lodash');
|
|||||||
const zlib = require('zlib');
|
const zlib = require('zlib');
|
||||||
|
|
||||||
const HomebrewSchema = mongoose.Schema({
|
const HomebrewSchema = mongoose.Schema({
|
||||||
shareId : { type: String, default: nanoid(12), index: { unique: true } },
|
shareId : { type: String, default: ()=>{return nanoid(12);}, index: { unique: true } },
|
||||||
editId : { type: String, default: nanoid(12), index: { unique: true } },
|
editId : { type: String, default: ()=>{return nanoid(12);}, index: { unique: true } },
|
||||||
title : { type: String, default: '' },
|
title : { type: String, default: '' },
|
||||||
text : { type: String, default: '' },
|
text : { type: String, default: '' },
|
||||||
textBin : { type: Buffer },
|
textBin : { type: Buffer },
|
||||||
|
|||||||
Reference in New Issue
Block a user