Skip to content

Commit 7b9947d

Browse files
committed
added listing creation route
1 parent 1f4791d commit 7b9947d

File tree

14 files changed

+463
-3674
lines changed

14 files changed

+463
-3674
lines changed

apollo/client-configs/apollo-error-handler.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

apollo/client-configs/default.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/TheHeader.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@
3838
</a>
3939
</div>
4040

41+
<div v-if="$auth.loggedIn" class="text-anthrazit font-bold">
42+
<nuxt-link to="/catalog/newlisting" class="whitespace-no-wrap hover:text-white rounded-full block hover:bg-primary px-4 py-2">Jetzt verkaufen</nuxt-link>
43+
</div>
44+
4145
<div class="text-anthrazit font-bold">
42-
<a @click="login()" href="#" class="rounded-full shadow block hover:bg-primary px-4 py-2 lg:ml-3">
46+
<a v-if="$auth.loggedIn" @click="$auth.logout()" href="#" class="rounded-full shadow block hover:bg-primary px-4 py-2 lg:ml-3">
47+
Ausloggen
48+
</a>
49+
<a v-else @click="login()" href="#" class="rounded-full shadow block hover:bg-primary px-4 py-2 lg:ml-3">
4350
Einloggen
4451
</a>
4552
</div>

middleware/load-products.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
export default async function({store}){
3+
await store.dispatch('catalog/loadAll');
4+
}

nuxt.config.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export default {
32
mode: 'universal',
43
/*
@@ -42,26 +41,25 @@ export default {
4241
modules: [
4342
'@nuxtjs/pwa',
4443
'@nuxtjs/axios',
45-
'@nuxtjs/apollo',
4644
'@nuxtjs/auth'
4745
],
46+
axios: {
47+
baseURL: 'http://localhost:8000'
48+
},
4849
auth: {
50+
redirect: {
51+
login: '/', // redirect user when not connected
52+
callback: '/auth/login'
53+
},
4954
strategies: {
50-
local: false,
55+
local:false,
5156
auth0: {
5257
domain: 'dev-y9r4orc7.eu.auth0.com',
5358
client_id: 'fkc1QGnc1Ze0LELobaIU9WKszo06B3j3',
5459
audience: 'https://unicircle-graphql'
5560
}
5661
}
5762
},
58-
apollo: {
59-
includeNodeModules: true,
60-
errorHandler: '~/apollo/client-configs/apollo-error-handler.js',
61-
clientConfigs: {
62-
default: '~/apollo/client-configs/default.js'
63-
}
64-
},
6563
/*
6664
** Build configuration
6765
*/

0 commit comments

Comments
 (0)