ci: format
This commit is contained in:
parent
d95d9c84fd
commit
4ad31ec804
2 changed files with 9 additions and 14 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
local oauth = require('pending.sync.oauth')
|
|
||||||
local config = require('pending.config')
|
local config = require('pending.config')
|
||||||
|
local oauth = require('pending.sync.oauth')
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
|
@ -22,8 +22,11 @@ local function find_or_create_calendar(access_token)
|
||||||
local gc = (cfg.sync and cfg.sync.gcal) or {}
|
local gc = (cfg.sync and cfg.sync.gcal) or {}
|
||||||
local cal_name = gc.calendar or 'Pendings'
|
local cal_name = gc.calendar or 'Pendings'
|
||||||
|
|
||||||
local data, err =
|
local data, err = oauth.curl_request(
|
||||||
oauth.curl_request('GET', BASE_URL .. '/users/me/calendarList', oauth.auth_headers(access_token))
|
'GET',
|
||||||
|
BASE_URL .. '/users/me/calendarList',
|
||||||
|
oauth.auth_headers(access_token)
|
||||||
|
)
|
||||||
if err then
|
if err then
|
||||||
return nil, err
|
return nil, err
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
local oauth = require('pending.sync.oauth')
|
|
||||||
local config = require('pending.config')
|
local config = require('pending.config')
|
||||||
|
local oauth = require('pending.sync.oauth')
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
|
@ -99,11 +99,7 @@ end
|
||||||
local function update_gtask(access_token, list_id, task_id, body)
|
local function update_gtask(access_token, list_id, task_id, body)
|
||||||
local _, err = oauth.curl_request(
|
local _, err = oauth.curl_request(
|
||||||
'PATCH',
|
'PATCH',
|
||||||
BASE_URL
|
BASE_URL .. '/lists/' .. oauth.url_encode(list_id) .. '/tasks/' .. oauth.url_encode(task_id),
|
||||||
.. '/lists/'
|
|
||||||
.. oauth.url_encode(list_id)
|
|
||||||
.. '/tasks/'
|
|
||||||
.. oauth.url_encode(task_id),
|
|
||||||
oauth.auth_headers(access_token),
|
oauth.auth_headers(access_token),
|
||||||
vim.json.encode(body)
|
vim.json.encode(body)
|
||||||
)
|
)
|
||||||
|
|
@ -117,11 +113,7 @@ end
|
||||||
local function delete_gtask(access_token, list_id, task_id)
|
local function delete_gtask(access_token, list_id, task_id)
|
||||||
local _, err = oauth.curl_request(
|
local _, err = oauth.curl_request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
BASE_URL
|
BASE_URL .. '/lists/' .. oauth.url_encode(list_id) .. '/tasks/' .. oauth.url_encode(task_id),
|
||||||
.. '/lists/'
|
|
||||||
.. oauth.url_encode(list_id)
|
|
||||||
.. '/tasks/'
|
|
||||||
.. oauth.url_encode(task_id),
|
|
||||||
oauth.auth_headers(access_token)
|
oauth.auth_headers(access_token)
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue