Skip to content
Snippets Groups Projects
Commit 6974bc3f authored by Martin Lowe's avatar Martin Lowe :flag_ca: Committed by Christopher Guindon
Browse files

Can't use "PUT" #33


Change-Id: Ie69c8c6b2cafb631a696071d72e06eb7db7738e0
Signed-off-by: Martin Lowe's avatarMartin Lowe <martin.lowe@eclipse-foundation.org>
parent 8641cc63
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
......@@ -73,8 +73,8 @@ public class CatalogResource {
* @param catalog the Catalog object to insert into the database.
* @return response for the browser
*/
@POST
public Response postCatalog(Catalog catalog) {
@PUT
public Response putCatalog(Catalog catalog) {
MongoQuery<Catalog> q = new MongoQuery<>(params, dtoFilter, cachingService);
// add the object, and await the result
StreamHelper.awaitCompletionStage(dao.add(q, Arrays.asList(catalog)));
......
......@@ -14,7 +14,7 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
......@@ -74,8 +74,8 @@ public class CategoryResource {
* @param category the Category object to insert into the database.
* @return response for the browser
*/
@POST
public Response postCategory(Category category) {
@PUT
public Response putCategory(Category category) {
MongoQuery<Category> q = new MongoQuery<>(params, dtoFilter, cachingService);
// add the object, and await the result
StreamHelper.awaitCompletionStage(dao.add(q, Arrays.asList(category)));
......
......@@ -14,7 +14,7 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
......@@ -83,8 +83,8 @@ public class ErrorReportResource {
* @param errorReport the ErrorReport object to insert into the database.
* @return response for the browser
*/
@POST
public Response postErrorReport(ErrorReport errorReport) {
@PUT
public Response putErrorReport(ErrorReport errorReport) {
MongoQuery<ErrorReport> q = new MongoQuery<>(params, dtoFilter, cachingService);
// add the object, and await the result
......
......@@ -17,7 +17,7 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
......@@ -86,8 +86,8 @@ public class ListingResource {
* @param listing the listing object to insert into the database.
* @return response for the browser
*/
@POST
public Response postListing(Listing listing) {
@PUT
public Response putListing(Listing listing) {
MongoQuery<Listing> q = new MongoQuery<>(params, dtoFilter, cachingService);
// add the object, and await the result
......
......@@ -14,7 +14,7 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
......@@ -75,8 +75,8 @@ public class MarketResource {
* @param market the Category object to insert into the database.
* @return response for the browser
*/
@POST
public Response postMarket(Market market) {
@PUT
public Response putMarket(Market market) {
MongoQuery<Market> q = new MongoQuery<>(params, dtoFilter, cachingService);
// add the object, and await the result
......
......@@ -68,7 +68,7 @@ function createListing(count) {
console.log(`Generating listing ${count} of ${max}`);
var json = generateJSON(uuid.v4());
axios.post(argv.s+"/listings/", json)
axios.put(argv.s+"/listings/", json)
.then(() => {
var installs = Math.floor(Math.random()*argv.i);
console.log(`Generating ${installs} install records for listing '${json.id}'`);
......@@ -82,7 +82,7 @@ function createCategory(count) {
return;
}
axios.post(argv.s+"/categories/", generateCategoryJSON(categoryIds[count++]))
axios.put(argv.s+"/categories/", generateCategoryJSON(categoryIds[count++]))
.then(() => createCategory(count))
.catch(err => console.log(err));
}
......@@ -92,7 +92,7 @@ function createMarket(count) {
return;
}
axios.post(argv.s+"/markets/", generateMarketJSON(marketIds[count++]))
axios.put(argv.s+"/markets/", generateMarketJSON(marketIds[count++]))
.then(() => createMarket(count))
.catch(err => console.log(err));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment