Update a couple of references to the new api code location

This commit is contained in:
Joey Wilhelm 2020-07-07 16:21:10 -04:00
Родитель ba26ed04c2
Коммит 30b93eec37
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -22,7 +22,7 @@ import apiPublicRepos from './publicRepos';
import { AzureDevOpsAuthenticationMiddleware } from '../middleware/apiVstsAuth';
import ReposApiAuthentication from '../middleware/apiReposAuth';
import { CreateRepository, CreateRepositoryEntrypoint } from './createRepo';
const supportMultipleAuthProviders = require('../../middleware/supportMultipleAuthProviders');
const supportMultipleAuthProviders = require('../middleware/supportMultipleAuthProviders');
const hardcodedApiVersions = [
'2019-10-01',
@ -104,13 +104,15 @@ router.post('/:org/repos', asyncHandler(async function (req: ReposAppRequest, re
try {
const repoCreateResponse = await CreateRepository(req, convergedObject, CreateRepositoryEntrypoint.Api);
res.status(201);
req.insights.trackEvent({ name: 'ApiRepoCreateRequestSuccess', properties: {
request: JSON.stringify(convergedObject),
response: JSON.stringify(repoCreateResponse),
}});
req.insights.trackEvent({
name: 'ApiRepoCreateRequestSuccess', properties: {
request: JSON.stringify(convergedObject),
response: JSON.stringify(repoCreateResponse),
}
});
return res.json(repoCreateResponse);
} catch (error) {
const data = {...convergedObject};
const data = { ...convergedObject };
data.error = error.message;
data.encodedError = JSON.stringify(error);
req.insights.trackEvent({ name: 'ApiRepoCreateFailed', properties: data });

Просмотреть файл

@ -8,7 +8,7 @@ const router = express.Router();
import { webContextMiddleware } from '../middleware/business/setContext';
router.use('/api', require('./api'));
router.use('/api', require('../api'));
router.use(webContextMiddleware);