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';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create playlist',
|
||||
@@ -8,7 +8,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Playlist name',
|
||||
key: 'playlistName',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'Playlist name',
|
||||
variables: true,
|
||||
@@ -16,7 +16,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Playlist visibility',
|
||||
key: 'playlistVisibility',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: 'Playlist visibility',
|
||||
variables: true,
|
||||
@@ -28,7 +28,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Playlist description',
|
||||
key: 'playlistDescription',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: 'Playlist description',
|
||||
variables: true,
|
||||
@@ -36,12 +36,10 @@ export default defineAction({
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const playlistName = $.step.parameters.playlistName as string;
|
||||
const playlistDescription = $.step.parameters.playlistDescription as string;
|
||||
const playlistName = $.step.parameters.playlistName;
|
||||
const playlistDescription = $.step.parameters.playlistDescription;
|
||||
const playlistVisibility =
|
||||
$.step.parameters.playlistVisibility === 'public'
|
||||
? true
|
||||
: (false as boolean);
|
||||
$.step.parameters.playlistVisibility === 'public' ? true : false;
|
||||
|
||||
const response = await $.http.post(
|
||||
`v1/users/${$.auth.data.userId}/playlists`,
|
||||
3
packages/backend/src/apps/spotify/actions/index.js
Normal file
3
packages/backend/src/apps/spotify/actions/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import cratePlaylist from './create-playlist/index.js';
|
||||
|
||||
export default [cratePlaylist];
|
||||
@@ -1,3 +0,0 @@
|
||||
import cratePlaylist from './create-playlist';
|
||||
|
||||
export default [cratePlaylist];
|
||||
Reference in New Issue
Block a user