Réglage PUT et DELETE + Photos
This commit is contained in:
parent
e39f423787
commit
fb2673ffc8
5 changed files with 15 additions and 14 deletions
14
api_proximo/composer.lock
generated
14
api_proximo/composer.lock
generated
|
@ -478,22 +478,22 @@
|
|||
},
|
||||
{
|
||||
"name": "fruitcake/laravel-cors",
|
||||
"version": "v2.0.2",
|
||||
"version": "v2.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fruitcake/laravel-cors.git",
|
||||
"reference": "4b19bfc3bd422948af37a42a62fad7f49025894a"
|
||||
"reference": "01de0fe5f71c70d1930ee9a80385f9cc28e0f63a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/4b19bfc3bd422948af37a42a62fad7f49025894a",
|
||||
"reference": "4b19bfc3bd422948af37a42a62fad7f49025894a",
|
||||
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/01de0fe5f71c70d1930ee9a80385f9cc28e0f63a",
|
||||
"reference": "01de0fe5f71c70d1930ee9a80385f9cc28e0f63a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"asm89/stack-cors": "^2.0.1",
|
||||
"illuminate/contracts": "^6|^7|^8",
|
||||
"illuminate/support": "^6|^7|^8",
|
||||
"illuminate/contracts": "^6|^7|^8|^9",
|
||||
"illuminate/support": "^6|^7|^8|^9",
|
||||
"php": ">=7.2",
|
||||
"symfony/http-foundation": "^4|^5",
|
||||
"symfony/http-kernel": "^4.3.4|^5"
|
||||
|
@ -547,7 +547,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-09-07T11:48:52+00:00"
|
||||
"time": "2020-10-22T13:57:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "graham-campbell/result-type",
|
||||
|
|
|
@ -17,9 +17,9 @@ return [
|
|||
|
||||
'paths' => ['api/*'],
|
||||
|
||||
'allowed_methods' => ['*'],
|
||||
'allowed_methods' => ['POST', 'GET', 'DELETE', 'PUT', '*'],
|
||||
|
||||
'allowed_origins' => ['*'],
|
||||
'allowed_origins' => ['http://localhost:3000', 'https://etud.insa-toulouse.fr/~proximo/v2','*'],
|
||||
|
||||
'allowed_origins_patterns' => [],
|
||||
|
||||
|
|
|
@ -111,14 +111,14 @@ class ArticleDetails extends React.Component {
|
|||
</div>
|
||||
</div>
|
||||
<div id="categoryDiv">
|
||||
<img onClick={() => this.props.handleCategories(this.props.category)} id="categoryIcon" alt="bonjour" src={`https://etud.insa-toulouse.fr/~proximo/v2/storage/icon/${this.props.category.icon}`}/>
|
||||
<img onClick={() => this.props.handleCategories(this.props.category)} id="categoryIcon" alt="bonjour" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/icon/${this.props.category.icon}`}/>
|
||||
</div>
|
||||
<div id="descandprice">
|
||||
<h1 id="desc">{this.props.desc}</h1>
|
||||
<p id ="price">{this.props.price} €</p>
|
||||
</div>
|
||||
</>
|
||||
: <img id="image" src={`https://etud.insa-toulouse.fr/~proximo/v2/storage/img/${this.props.img}`} alt='bonjour'/>
|
||||
: <img id="image" src={`https://etud.insa-toulouse.fr/~proximo/api_proximo/storage/app/public/img/${this.props.img}`} alt='bonjour'/>
|
||||
}
|
||||
</div>
|
||||
<h1 id="name">{this.props.name}</h1>
|
||||
|
|
|
@ -96,10 +96,11 @@ class EditArticle extends React.Component {
|
|||
this.setState({errors : []})
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
if(error.response.status === 401){
|
||||
this.setState({errors : error.response.data.errors})
|
||||
}
|
||||
console.log(error.response.data.errors)
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -111,10 +112,10 @@ class EditArticle extends React.Component {
|
|||
this.props.handleCloseAbove();
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error)
|
||||
if(error.response.status === 401){
|
||||
this.setState({errors : error.response.data.errors})
|
||||
}
|
||||
console.log(error.response.data.errors)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ export default class Stock extends React.Component {
|
|||
axios.post('https://etud.insa-toulouse.fr/~proximo/v2/api/articles/sort',bodyFormData)
|
||||
.then(res => {
|
||||
this.setState({articles : res.data}, () => {
|
||||
console.log(this.state)
|
||||
console.log(this.state.articles)
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
Loading…
Reference in a new issue