feat: Convert all app files to JS
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
import { URLSearchParams } from 'url';
|
||||
|
||||
export default defineAction({
|
||||
@@ -9,7 +9,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Title',
|
||||
key: 'title',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description:
|
||||
'Heading for the recent post. Limited to 300 characters or less.',
|
||||
@@ -18,7 +18,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Subreddit',
|
||||
key: 'subreddit',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'The subreddit for posting. Note: Exclude /r/.',
|
||||
variables: true,
|
||||
@@ -26,7 +26,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Url',
|
||||
key: 'url',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
@@ -39,9 +39,9 @@ export default defineAction({
|
||||
const params = new URLSearchParams({
|
||||
kind: 'link',
|
||||
api_type: 'json',
|
||||
title: title as string,
|
||||
sr: subreddit as string,
|
||||
url: url as string,
|
||||
title: title,
|
||||
sr: subreddit,
|
||||
url: url,
|
||||
});
|
||||
|
||||
const { data } = await $.http.post('/api/submit', params.toString());
|
||||
3
packages/backend/src/apps/reddit/actions/index.js
Normal file
3
packages/backend/src/apps/reddit/actions/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import createLinkPost from './create-link-post/index.js';
|
||||
|
||||
export default [createLinkPost];
|
||||
@@ -1,3 +0,0 @@
|
||||
import createLinkPost from './create-link-post';
|
||||
|
||||
export default [createLinkPost];
|
||||
Reference in New Issue
Block a user