screwdriver-api 8.0.193 → 8.0.194

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "8.0.193",
3
+ "version": "8.0.194",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -295,10 +295,6 @@ module.exports = () => ({
295
295
 
296
296
  const event = await createEvent(payload, request.server);
297
297
 
298
- if (event.builds === null) {
299
- return boom.notFound('No jobs to start.');
300
- }
301
-
302
298
  // everything succeeded, inform the user
303
299
  const location = urlLib.format({
304
300
  host: request.headers.host,
@@ -307,6 +303,15 @@ module.exports = () => ({
307
303
  pathname: `${request.path}/${event.id}`
308
304
  });
309
305
 
306
+ if (event.builds === null) {
307
+ return h
308
+ .response(event.toJson())
309
+ .header('X-Status-Message', 'No jobs to start.')
310
+ .header('Access-Control-Expose-Headers', 'X-Status-Message')
311
+ .header('Location', location)
312
+ .code(201);
313
+ }
314
+
310
315
  return h.response(event.toJson()).header('Location', location).code(201);
311
316
  },
312
317
  validate: {