File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed
homepage/src/routes/api/check-updates Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 88 },
99 "package" : {
1010 "productName" : " Haptic" ,
11- "version" : " 0.1.2 "
11+ "version" : " 0.1.3 "
1212 },
1313 "tauri" : {
1414 "allowlist" : {
5656 },
5757 "updater" : {
5858 "active" : true ,
59- "endpoints" : [" https://releases.myapp.com/{{target}}/{{arch}}/{{current_version}}" ],
59+ "endpoints" : [
60+ " https://haptic.md/api/check-updates?target={{target}}&arch={{arch}}¤tVersion={{current_version}}"
61+ ],
6062 "dialog" : true ,
6163 "windows" : {
6264 "installMode" : " passive"
Original file line number Diff line number Diff line change @@ -19,18 +19,16 @@ export const GET: RequestHandler = async ({ url }) => {
1919 const arch = url . searchParams . get ( 'arch' ) as Arch | undefined ;
2020
2121 // Parse target and arch and validate with type
22- if ( ! target || ! arch ) {
23- if ( ! target || ! arch || ! currentVersion ) {
24- return new Response (
25- JSON . stringify ( {
26- error : 'Missing required parameters. Please provide target, arch, and currentVersion.'
27- } ) ,
28- {
29- status : 400 ,
30- headers : { 'Content-Type' : 'application/json' }
31- }
32- ) ;
33- }
22+ if ( ! target || ! arch || ! currentVersion ) {
23+ return new Response (
24+ JSON . stringify ( {
25+ error : 'Missing required parameters. Please provide target, arch, and currentVersion.'
26+ } ) ,
27+ {
28+ status : 400 ,
29+ headers : { 'Content-Type' : 'application/json' }
30+ }
31+ ) ;
3432 }
3533
3634 // Validate target
@@ -64,7 +62,7 @@ export const GET: RequestHandler = async ({ url }) => {
6462 const edgeConfig = ( await configClient . getAll ( ) ) as { latest_version : string ; notes ?: string } ;
6563
6664 // Validate versions
67- if ( currentVersion === edgeConfig . latest_version ) {
65+ if ( currentVersion . replace ( 'v' , '' ) === edgeConfig . latest_version . replace ( 'v' , '' ) ) {
6866 return new Response ( null , { status : 204 } ) ;
6967 }
7068
You can’t perform that action at this time.
0 commit comments