From 76e6145ceda531739c941a53d7848b54e3a7995a Mon Sep 17 00:00:00 2001 From: Nick Gottlieb Date: Tue, 2 Feb 2021 16:06:38 -0800 Subject: [PATCH] fix usage of nanoid to match documentation --- src/app/plugins/random-id.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/plugins/random-id.js b/src/app/plugins/random-id.js index 89ad0206..1246a239 100644 --- a/src/app/plugins/random-id.js +++ b/src/app/plugins/random-id.js @@ -1,6 +1,6 @@ import Vue from 'vue' -import { nanoid } from 'nanoid' +import { customAlphabet } from 'nanoid' /** * @description use this when creating new resources. @@ -9,5 +9,6 @@ import { nanoid } from 'nanoid' */ Vue.prototype.$randomId = function () { - return nanoid(21, '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') + const nanoid = customAlphabet('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 21); + return nanoid(); }