This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- head --> | |
| <style> | |
| .loading { | |
| background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%); | |
| animation: load 1.9s linear infinite; | |
| height: 20px; | |
| position: relative; | |
| width: 100% | |
| } | |
| .mask { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div ref="imgComponent"> | |
| <img v-if="check" :src="dataSrc" :alt="dataAlt" class="thumbnail"> | |
| <div class="loading loading-img" v-else></div> <!-- Placeholder yang sama dengan saat pertama kali load --> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| data() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "vue-rss-feed", | |
| "short_name": "vue-rss-feed", | |
| "icons": [ | |
| { | |
| "src": "/static/img/icons/android-chrome-192x192.png", | |
| "sizes": "192x192", | |
| "type": "image/png" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require('axios') | |
| const doTest = async (idx) => { | |
| const { data } = await axios.post( | |
| 'http://localhost:3000/orders/create', | |
| { | |
| items: [ | |
| { | |
| id: 6, //id produk | |
| item: 2, //jumlah produk yg dibeli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const router = require('express').Router() | |
| const kue = require('kue') | |
| const queue = kue.createQueue() | |
| queue.process('order', async (job, done) => { | |
| try { | |
| let outOfStock = { | |
| bool: false, | |
| data: [], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const router = require('express').Router(); | |
| const { Product } = require('../models/') | |
| router.post('order', (req, res) => { | |
| try { | |
| let outOfStock = { | |
| bool: false, | |
| data: [] | |
| } | |
| let allProduct = await Product.findAll({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #typeDefs.graphql | |
| type Query{ | |
| allMerchants: [Merchant!]! | |
| } | |
| type Merchant { | |
| id: ID! | |
| name: String! | |
| products: [Product!]! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // graphql.ts | |
| import 'graphql-import-node'; | |
| import {makeExecutableSchema} from 'graphql-tools'; | |
| import {ApolloServer} from 'apollo-server-express'; | |
| import Knex from 'knex'; | |
| import Dataloader from 'dataloader'; | |
| import config from 'config'; | |
| import resolvers from './resolvers'; | |
| import * as typeDefs from './typeDefs.graphql'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // resolvers.ts | |
| import Knex from 'knex'; | |
| import {IGraphQLSchemaContext, Merchant} from '../../types'; | |
| export default { | |
| Query: { | |
| allMerchants() { | |
| return Knex(config.get('database'))('merchants'); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #typeDefs.graphql | |
| type Query{ | |
| allMerchants: [Merchant!]! | |
| } | |
| type Merchant { | |
| id: ID! | |
| name: String! | |
| products(pagination: PaginationInput!): [Product!]! |
OlderNewer