Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
afd60a78
Commit
afd60a78
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
order projects by date
parent
2163cb99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!3
add export-geojson & fix slug vs title in feature_list route
,
!2
add extra_form to feature_edit
,
!1
format date for derniers signalements, detect click outside menu dropdown and...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.js
+1
-1
1 addition, 1 deletion
src/main.js
src/store/index.js
+9
-6
9 additions, 6 deletions
src/store/index.js
with
10 additions
and
7 deletions
src/main.js
+
1
−
1
View file @
afd60a78
...
...
@@ -8,7 +8,7 @@ import store from './store'
Vue
.
config
.
productionTip
=
false
axios
.
all
([
store
.
dispatch
(
"
GET_PROJECTS
"
),
store
.
dispatch
(
"
GET_STATIC_PAGES
"
)]).
then
(
axios
.
spread
(
function
()
{
axios
.
all
([
store
.
dispatch
(
"
GET_
ALL_
PROJECTS
"
),
store
.
dispatch
(
"
GET_STATIC_PAGES
"
)]).
then
(
axios
.
spread
(
function
()
{
new
Vue
({
router
,
store
,
...
...
This diff is collapsed.
Click to expand it.
src/store/index.js
+
9
−
6
View file @
afd60a78
...
...
@@ -7,11 +7,11 @@ import router from '../router'
Vue
.
use
(
Vuex
);
const
GET_PROJECT_USER
=
GET_PROJECT_USER
;
const
GET_PROJECTS
=
GET_PROJECTS
;
/*
const GET_PROJECT_USER = GET_PROJECT_USER;
const GET_
ALL_
PROJECTS = GET_
ALL_
PROJECTS;
const CHECK_LOGIN = CHECK_LOGIN;
const SET_COOKIE = SET_COOKIE;
const
SET_STATIC_PAGES
=
SET_STATIC_PAGES
;
const SET_STATIC_PAGES = SET_STATIC_PAGES;
*/
export
default
new
Vuex
.
Store
({
...
...
@@ -47,10 +47,13 @@ export default new Vuex.Store({
},
actions
:
{
async
GET_PROJECTS
({
commit
})
{
async
GET_
ALL_
PROJECTS
({
commit
})
{
await
axios
.
get
(
"
http://localhost:8000/api/projects/
"
)
.
then
((
response
)
=>
(
commit
(
"
SET_PROJECTS
"
,
response
.
data
)))
.
then
((
response
)
=>
{
const
orderedProjects
=
response
.
data
.
sort
((
a
,
b
)
=>
new
Date
(
b
.
created_on
)
-
new
Date
(
a
.
created_on
));
commit
(
"
SET_PROJECTS
"
,
orderedProjects
)
})
.
catch
((
error
)
=>
{
throw
error
;
});
...
...
@@ -66,7 +69,7 @@ export default new Vuex.Store({
GET_PROJECT
({
commit
},
project_slug
)
{
axios
.
get
(
`http://localhost:8000/api/projet/
${
project_slug
}
/project`
)
.
then
((
response
)
=>
(
commit
(
"
SET_PROJECT
"
,
response
.
data
))
)
.
then
((
response
)
=>
commit
(
"
SET_PROJECT
"
,
response
.
data
))
.
catch
((
error
)
=>
{
throw
error
;
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment