Skip to content

API Routes

Emily Parkes edited this page Jun 14, 2023 · 12 revisions

Creations

GET /api/v1/creations

returns

[
	{
		"id": 1,
		"clayId": 1,
		"clay": "White",
		"shapeId": 5,
		"shape": "Vase",
		"statusId": 2,
		"status": "Leather Hard",
		"weightLeatherHard": 0,
		"weightBoneDry": 0,
		"weightBisqueFired": 0,
		"weightGlazed": 0,
		"weightComplete": 0,
		"dateCreated": "2020-06-15T13:45:30",
		"dateComplete": "2020-07-15T13:45:30",
		"description": "Creations by emily is great",
		"note": "Glaze with criss-cross pattern",
		"name": "Le Vase",
		"imgLeatherHard": null,
		"imgBisqueFired": null,
		"imgGlazed": null,
		"imgComplete": "/images/vase.png",
		"imgGallery": null,
		"glazes": [
			{
				"id": 1,
				"glaze": "Clear"
			},
			{
				"id": 10,
				"glaze": "White"
			},
			{
				"id": 11,
				"glaze": "Peach"
			}
		]
	},
	{
		"id": 2,
		"clayId": 2,
		"clay": "Grey Pebble",
		"shapeId": 2,
		"shape": "Plate",
		"statusId": 1,
		"status": "Wet",
		"weightLeatherHard": 0,
		"weightBoneDry": 0,
		"weightBisqueFired": 0,
		"weightGlazed": 0,
		"weightComplete": 0,
		"dateCreated": "2020-05-24T14:45:30",
		"dateComplete": "2020-06-24T14:45:30",
		"description": "",
		"note": "Glaze with criss-cross pattern",
		"name": "Le Plate",
		"imgLeatherHard": null,
		"imgBisqueFired": null,
		"imgGlazed": null,
		"imgComplete": "",
		"imgGallery": null,
		"glazes": [
			{
				"id": 1,
				"glaze": "Clear"
			},
			{
				"id": 10,
				"glaze": "White"
			}
		]
	},
...]

GET /api/v1/creations/2

returns

{
	"id": 2,
	"clayId": 2,
	"clay": "Grey Pebble",
	"shapeId": 2,
	"shape": "Plate",
	"statusId": 1,
	"status": "Wet",
	"weightLeatherHard": 0,
	"weightBoneDry": 0,
	"weightBisqueFired": 0,
	"weightGlazed": 0,
	"weightComplete": 0,
	"dateCreated": "2020-05-24T14:45:30",
	"dateComplete": "2020-06-24T14:45:30",
	"description": "",
	"note": "Glaze with criss-cross pattern",
	"name": "Le Plate",
	"imgLeatherHard": null,
	"imgBisqueFired": null,
	"imgGlazed": null,
	"imgComplete": "",
	"imgGallery": null,
	"glazes": [
		{
			"id": 1,
			"glaze": "Clear"
		},
		{
			"id": 10,
			"glaze": "White"
		}
	]
}

POST /api/v1/creations/new-creation

sends

{
	"clayId": 1,
	"glazes": [{"id": 1, "glaze": "Clear"}],
	"name": "Espresso mini",
	"note": "hi",
	"shapeId": 1,
 	"statusId": 1,
	"weight": "123"
}

returns

{
	"id": 12,
	"clayId": 1,
	"clay": "White",
	"shapeId": 1,
	"shape": "Coffee Cup",
	"statusId": 1,
	"status": "Wet",
	"weightLeatherHard": null,
	"weightBoneDry": null,
	"weightBisqueFired": null,
	"weightGlazed": null,
	"weightComplete": null,
	"dateCreated": null,
	"dateComplete": null,
	"description": null,
	"note": "hi",
	"name": "Espresso mini",
	"imgLeatherHard": null,
	"imgBisqueFired": null,
	"imgGlazed": null,
	"imgComplete": null,
	"imgGallery": null,
	"glazes": [
		{
			"id": 1,
			"glaze": "Clear"
		}
	]
}

PATCH /api/v1/creations/update-creation/2

sends

{
	"id": 12,
	"clayId": 1,
	"clay": "White",
	"shapeId": 1,
	"shape": "Coffee Cup",
	"statusId": 1,
	"status": "Wet",
	"weightLeatherHard": null,
	"weightBoneDry": null,
	"weightBisqueFired": null,
	"weightGlazed": null,
	"weightComplete": null,
	"dateCreated": null,
	"dateComplete": null,
	"description": null,
	"note": "hi",
	"name": "Emily Test 1",
	"imgLeatherHard": null,
	"imgBisqueFired": null,
	"imgGlazed": null,
	"imgComplete": null,
	"imgGallery": null,
	"glazes": [
		{
			"id": 1,
			"glaze": "Clear"
		}
	]
}

returns

{
	"id": 12,
	"clayId": 1,
	"clay": "White",
	"shapeId": 1,
	"shape": "Coffee Cup",
	"statusId": 1,
	"status": "Wet",
	"weightLeatherHard": null,
	"weightBoneDry": null,
	"weightBisqueFired": null,
	"weightGlazed": null,
	"weightComplete": null,
	"dateCreated": null,
	"dateComplete": null,
	"description": null,
	"note": "hi",
	"name": "Emily Test 1",
	"imgLeatherHard": null,
	"imgBisqueFired": null,
	"imgGlazed": null,
	"imgComplete": null,
	"imgGallery": null,
	"glazes": [
		{
			"id": 1,
			"glaze": "Clear"
		}
	]
}

Table of Contents

Design

Front-End

Back-End

Clone this wiki locally