Open lwcsharp opened 7 months ago
-- post /story/players/test-2 -d "A" update players set hp= hp + (select effect from player_paths where choice = 'A' and username = 'test'), storypoint_id = (select to_point from player_paths where choice = 'A' and username = 'test') where username = 'test' returning (select content from player_paths where choice = 'A' and username = 'test');
-- Advance story by following the chosen player path update players set hp= hp - (select effect from player_paths where choice = 'CONTINUE' and username = 'test'), storypoint_id = (select to_point from player_paths where choice = 'CONTINUE' and username = 'test') where username = 'test' returning (select content from player_paths where choice = 'CONTINUE' and username = 'test') ;
-- post /story/players/test-2 -d "CONTINUE" curl -X POST update players set hp= hp - (select effect from player_paths where choice = $2 and username = $1), storypoint_id = (select to_point from player_paths where choice = 'CONTINUE' and username = 'test') where username = 'test' returning (select content from player_paths where choice = 'CONTINUE' and username = 'test');