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
/** | |
* Implement Gatsby's Node APIs in this file. | |
* | |
* See: https://www.gatsbyjs.org/docs/node-apis/ | |
*/ | |
// You can delete this file if you're not using it | |
const axios = require(`axios`) | |
exports.createPages = async({ actions: { createPage }, 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
function resizeElementHeight(element) { | |
var height = 0; | |
var body = window.document.body; | |
if (window.innerHeight) { | |
height = window.innerHeight; | |
} else if (body.parentElement.clientHeight) { | |
height = body.parentElement.clientHeight; | |
} else if (body && body.clientHeight) { | |
height = body.clientHeight; | |
} |
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
# Implementation | |
module CSVImportable | |
extend ActiveSupport::Concern | |
included do | |
def self.import(file) | |
CSV.foreach(file.path, headers: true, encoding:'utf-8') do |row| | |
self.create! row.to_hash | |
end |
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
# 確定目前到這個號碼,是否有需要提醒的使用者。 | |
class QueueCallSetReminderService | |
attr_reader :reminders_to_push, :current_queue_records, :queue_rule, :shop, :shop_reminders | |
def self.call(*args) | |
QueueCallSetReminderService.new(*args).call | |
end | |
def initialize(shop, current_queue_records) | |
@shop = shop |
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
1. 將以下資料 POST 到 /device_auth/authorize | |
- identifier_token,格式為 UUID | |
- os,請傳 iphone || ipad | |
會拿到 access_token | |
2. 將以下資料 post 到 /mobile/notification_services | |
- access_token | |
- apnl_token | |
server 會在 aws - sns 服務上註冊裝置資料 | |
以上為準備工作,如果流程都順利,便可進行收訊息測試: |
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
module Modules::Manageable | |
extend ActiveSupport::Concern | |
included do | |
default_scope -> {order(position: :asc)} | |
after_create :add_position | |
before_destroy :decrease_position_when_delete_one | |
end | |
def add_position |