@@ -52,6 +52,122 @@ pub async fn special_error_missing_custom_domain(
5252 SpecialErrorService :: missing_custom_domain ( ctx, & locales, & domain) . await
5353}
5454
55+ pub async fn special_error_missing_page_slug (
56+ ctx : & ServiceContext < ' _ > ,
57+ params : Params < ' static > ,
58+ ) -> Result < SpecialErrorOutput > {
59+ #[ derive( Deserialize , Debug ) ]
60+ struct Input {
61+ locales : Vec < String > ,
62+ site_id : i64 ,
63+ page_slug : String ,
64+ }
65+
66+ let Input {
67+ locales,
68+ site_id,
69+ page_slug,
70+ } = params. parse ( ) ?;
71+
72+ let locales = parse_locales ( & locales) ?;
73+ SpecialErrorService :: missing_page_slug ( ctx, & locales, site_id, & page_slug) . await
74+ }
75+
76+ pub async fn special_error_page_fetch (
77+ ctx : & ServiceContext < ' _ > ,
78+ params : Params < ' static > ,
79+ ) -> Result < SpecialErrorOutput > {
80+ #[ derive( Deserialize , Debug ) ]
81+ struct Input {
82+ locales : Vec < String > ,
83+ site_id : i64 ,
84+ page_slug : String ,
85+ }
86+
87+ let Input {
88+ locales,
89+ site_id,
90+ page_slug,
91+ } = params. parse ( ) ?;
92+
93+ let locales = parse_locales ( & locales) ?;
94+ SpecialErrorService :: page_fetch ( ctx, & locales, site_id, & page_slug) . await
95+ }
96+
97+ pub async fn special_error_missing_file_name (
98+ ctx : & ServiceContext < ' _ > ,
99+ params : Params < ' static > ,
100+ ) -> Result < SpecialErrorOutput > {
101+ #[ derive( Deserialize , Debug ) ]
102+ struct Input {
103+ locales : Vec < String > ,
104+ site_id : i64 ,
105+ page_slug : String ,
106+ filename : String ,
107+ }
108+
109+ let Input {
110+ locales,
111+ site_id,
112+ page_slug,
113+ filename,
114+ } = params. parse ( ) ?;
115+
116+ let locales = parse_locales ( & locales) ?;
117+ SpecialErrorService :: missing_file_name ( ctx, & locales, site_id, & page_slug, & filename)
118+ . await
119+ }
120+
121+ pub async fn special_error_file_fetch (
122+ ctx : & ServiceContext < ' _ > ,
123+ params : Params < ' static > ,
124+ ) -> Result < SpecialErrorOutput > {
125+ #[ derive( Deserialize , Debug ) ]
126+ struct Input {
127+ locales : Vec < String > ,
128+ site_id : i64 ,
129+ page_slug : String ,
130+ filename : String ,
131+ }
132+
133+ let Input {
134+ locales,
135+ site_id,
136+ page_slug,
137+ filename,
138+ } = params. parse ( ) ?;
139+
140+ let locales = parse_locales ( & locales) ?;
141+ SpecialErrorService :: file_fetch ( ctx, & locales, site_id, & page_slug, & filename) . await
142+ }
143+
144+ pub async fn special_error_text_block (
145+ ctx : & ServiceContext < ' _ > ,
146+ params : Params < ' static > ,
147+ ) -> Result < SpecialErrorOutput > {
148+ #[ derive( Deserialize , Debug ) ]
149+ struct Input {
150+ locales : Vec < String > ,
151+ site_id : i64 ,
152+ index : String ,
153+ block_type : String ,
154+ reason : String ,
155+ }
156+
157+ let Input {
158+ locales,
159+ site_id,
160+ index,
161+ block_type,
162+ reason,
163+ } = params. parse ( ) ?;
164+
165+ let locales = parse_locales ( & locales) ?;
166+
167+ SpecialErrorService :: text_block ( ctx, & locales, site_id, & index, & block_type, & reason)
168+ . await
169+ }
170+
55171pub async fn special_error_file_root (
56172 ctx : & ServiceContext < ' _ > ,
57173 params : Params < ' static > ,
0 commit comments