forked from external-repos/noisedash
Add profile name field to import
This commit is contained in:
@@ -49,7 +49,7 @@ router.post('/profiles', (req, res) => {
|
||||
function (err) {
|
||||
if (err) {
|
||||
logger.error(err)
|
||||
if (err.code === 'SQLITE_CONSTRAINT') {
|
||||
if (err.code === 'SQLITE_CONSTRAINT_UNIQUE') {
|
||||
return res.sendStatus(409)
|
||||
} else {
|
||||
return res.sendStatus(500)
|
||||
@@ -123,7 +123,7 @@ router.post('/profiles/import', (req, res) => {
|
||||
function (err) {
|
||||
if (err) {
|
||||
logger.error(err)
|
||||
if (err.code === 'SQLITE_CONSTRAINT') {
|
||||
if (err.code === 'SQLITE_CONSTRAINT_UNIQUE') {
|
||||
return res.sendStatus(409)
|
||||
} else {
|
||||
return res.sendStatus(500)
|
||||
|
||||
@@ -49,7 +49,7 @@ router.post('/samples', upload.single('sample'), (req, res, next) => {
|
||||
if (err) {
|
||||
logger.error(err)
|
||||
deleteSample(req.user.id + '_' + req.body.name)
|
||||
if (err.code === 'SQLITE_CONSTRAINT') {
|
||||
if (err.code === 'SQLITE_CONSTRAINT_UNIQUE') {
|
||||
return res.sendStatus(409)
|
||||
} else {
|
||||
return res.sendStatus(500)
|
||||
|
||||
@@ -101,7 +101,7 @@ router.post('/users', (req, res) => {
|
||||
], (err) => {
|
||||
if (err) {
|
||||
logger.error(err)
|
||||
if (err.code === 'SQLITE_CONSTRAINT') {
|
||||
if (err.code === 'SQLITE_CONSTRAINT_UNIQUE') {
|
||||
return res.sendStatus(409)
|
||||
} else {
|
||||
return res.sendStatus(500)
|
||||
@@ -132,7 +132,7 @@ router.post('/users', (req, res) => {
|
||||
], function (err) {
|
||||
if (err) {
|
||||
logger.error(err)
|
||||
if (err.code === 'SQLITE_CONSTRAINT') {
|
||||
if (err.code === 'SQLITE_CONSTRAINT_UNIQUE') {
|
||||
return res.sendStatus(409)
|
||||
} else {
|
||||
return res.sendStatus(500)
|
||||
|
||||
@@ -207,6 +207,13 @@
|
||||
:rules="[rules.required()]"
|
||||
/>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-text-field
|
||||
v-model="importedProfileName"
|
||||
label="Profile Name"
|
||||
:rules="[rules.required()]"
|
||||
/>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
|
||||
@@ -16,6 +16,7 @@ export default {
|
||||
isImportValid: false,
|
||||
exportDialog: false,
|
||||
importedProfile: null,
|
||||
importedProfileName: '',
|
||||
exportedProfile: {},
|
||||
infoSnackbar: false,
|
||||
infoSnackbarText: '',
|
||||
@@ -458,7 +459,7 @@ export default {
|
||||
const profileJSON = JSON.parse(fileContents)
|
||||
|
||||
this.$http.post('/profiles/import', {
|
||||
name: profileJSON.name,
|
||||
name: this.importedProfileName,
|
||||
isTimerEnabled: profileJSON.isTimerEnabled,
|
||||
duration: profileJSON.duration,
|
||||
volume: profileJSON.volume,
|
||||
|
||||
Reference in New Issue
Block a user