Commit 26f5816a authored by Janik Münzenberger's avatar Janik Münzenberger
Browse files

Minor changes

parent e884b45c
......@@ -55,4 +55,43 @@ Header fields:
Key | Value | Description
--- | --- | ---
Authorization | *string*| The bearer token of logged in user ("Bearer " + token)
\ No newline at end of file
Authorization | *string*| The bearer token of logged in user ("Bearer " + token)
--> Success response:
```json
{
"success": true,
"data": [histories]
}
```
## Analysis
To access the history view a user must be logged in. So you have to provide an the bearer token for the backend.
GET `/api/analysis`
Header fields:
Key | Value | Description
--- | --- | ---
Authorization | *string*| The bearer token of logged in user ("Bearer " + token) (optional)
FormData fields:
Key | Value | Description
--- | --- | ---
crop_id | *number*| id of plant
image_file | *blob* | Image file of plant
email | *string* | Email to which result shall be sent
subscription | *NotificationSubscription* | Subscription if user allowed notifications (optional)
--> Success response:
```json
{
"success": true,
"method": "pull/push",
"data": "jobId"
}
```
\ No newline at end of file
const router = require('express').Router(),
Job = require('../model/job'),
const Job = require('../model/job'),
User = require('../model/user'),
rp = require('request-promise'),
errors = require('../lib/errors'),
......@@ -13,7 +12,7 @@ const router = require('express').Router(),
async function analysis(req, res) {
let cropId = req.body.crop_id;
const subscription = req.body.subscription;
console.log(subscription);
let jobImage = req.files.image_file;
let extension = req.files.image_file.name.split('.')[1];
let filename = `${randomstring.generate()}.${extension}`;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment