mirror of
https://github.com/caprover/caprover
synced 2026-09-26 00:25:38 +00:00
Returning project upon creation
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import configstore = require('configstore')
|
||||
import ApiStatusCodes from '../api/ApiStatusCodes'
|
||||
import { ProjectDefinition } from '../models/ProjectDefinition'
|
||||
import Utils from '../utils/Utils'
|
||||
import AppsDataStore from './AppsDataStore'
|
||||
import { ProjectDefinition } from '../models/ProjectDefinition'
|
||||
|
||||
const PROJECTS_DEFINITIONS = 'projectsDefinitions'
|
||||
|
||||
@@ -101,10 +101,12 @@ class ProjectsDataStore {
|
||||
description: project.description,
|
||||
}
|
||||
|
||||
return self.data.set(
|
||||
self.data.set(
|
||||
`${PROJECTS_DEFINITIONS}.${projectId}`,
|
||||
projectToSave
|
||||
)
|
||||
|
||||
return projectToSave
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { v4 as uuid } from 'uuid'
|
||||
import ApiStatusCodes from '../../api/ApiStatusCodes'
|
||||
import BaseApi from '../../api/BaseApi'
|
||||
import InjectionExtractor from '../../injection/InjectionExtractor'
|
||||
import Logger from '../../utils/Logger'
|
||||
import { ProjectDefinition } from '../../models/ProjectDefinition'
|
||||
import Logger from '../../utils/Logger'
|
||||
|
||||
const router = express.Router()
|
||||
|
||||
@@ -26,14 +26,14 @@ router.post('/register/', function (req, res, next) {
|
||||
description: description,
|
||||
})
|
||||
})
|
||||
.then(function () {
|
||||
.then(function (project) {
|
||||
Logger.d(`Project created: ${projectName}`)
|
||||
res.send(
|
||||
new BaseApi(
|
||||
ApiStatusCodes.STATUS_OK,
|
||||
`Project created: ${projectName}`
|
||||
)
|
||||
const resp = new BaseApi(
|
||||
ApiStatusCodes.STATUS_OK,
|
||||
`Project created: ${projectName}`
|
||||
)
|
||||
resp.data = project
|
||||
res.send(resp)
|
||||
})
|
||||
.catch(ApiStatusCodes.createCatcher(res))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user